back posts

Github repo backup script

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"


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"


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"

</toby>