For some time, I've been wanting to set up a backup for my Github repos. Technically they are all backed up by my local copies, which are also backed up when I back up my local computer. However, I wanted something that was sure to have everything from all the repos (all branches, tags, etc) and could be set up and run continuously on a yet-to-be-created backup server. I have create a bash script to do this for me. Continue reading post "Github repo backup script"
back posts
Simple MySQL backup script
I made a simple bash backup script for the newer MySQL database servers at Cogneato.
Continue reading post "Simple MySQL backup script"
Today at work, a feature I worked on went from fun and cool as I was building it to a stressful fix and recover operation after it unintentionally deleted important site files when deployed. Continue reading post "#2820"
PHP: Fallback for old constructor style
In versions of PHP before 5, constructors were functions with the same name as their class. PHP 5 introduced the __construct() unified name, and has deprecated the old style in PHP 7. Cogneato still has code remnants from long ago, with the old style. I recently worked on improving the compatibility of our old code with PHP 7.
Continue reading post "PHP: Fallback for old constructor style"
My health made it difficult to accomplish my plans this weekend, as back pain and other issues teamed up against me. Continue reading post "#2634"
Welp, got my first pingback / trackback spam since I closed regular comments about a month ago. Continue reading post "#2019"
I finally bought some bistro chairs for my backyard. Continue reading post "#1869"
Rsync incremental snapshots
I have been using rsync for backup and other things for a long time. It has a link-dest option that allows doing incremental snapshots similar to Time Machine on Macs.
Javascript: Objects and Callbacks
I've been doing my JavaScript coding directly in objects. Before I had been doing them without objects, then modifying them if I had time, but now that I have experience with JS objects, it is much nicer to do the OO straight off. When making objects that are versatile, allowing multiple instances, it is often necessary to be able to perform different operations for different instances. As an example, you might create a single class to handle auto-suggest type functionality, and want it to do different things when you choose one of its suggestions or cancel for different instances of its use. In JS, you could either create forks in the parent class for each possible behavior and use a test to determine which behavior is appropriate, or you could create a callback on instance instantiation or in a function call. The callback method can be very versatile and clean, allowing you to leave alone the core class and modify the calling class or global call.
Continue reading post "Javascript: Objects and Callbacks"Disappearing iPhoto Library
Today, I noticed a strange thing while doing a bit of filesystem cleanup: My entire iPhoto library, containing 8000+ images, had somehow turned into a 300k alias file pointing to nothing. Concerned, I looked elsewhere to make sure I hadn't just stored it in a different location for organization purposes and the alias had broken. I hadn't. Then I remembered earlier today noticing that my hard drive seemed significantly roomier than normal. I had just emptied the trash a couple days ago (usually don't empty often, just in case), but there shouldn't have been anything nearly that big in there.
Luckily, I use Apple's Time Machine for backup, plus my own other methods. In Time Machine, I went back about two weeks before the actual library was there. Restored it of course.
I have no idea what happened there. I hadn't used iPhoto or been reorganizing anything around that area for a full month. If I had somehow accidentally created an alias in the folder, there would be no reason it wouldn't perform he normal action of appending alias to the name.
Continue reading post "Disappearing iPhoto Library"