Skip to content

Instantly share code, notes, and snippets.

@dhrrgn
dhrrgn / init.rb
Created April 1, 2011 00:19
A simple initialization script to create vhosts.
#!/usr/bin/env ruby
# USAGE: sudo ./init.rb project_name path/to/web/root
# NOTE: This file must be run with root privileges (sudo).
# You must also give it exec permissions: chmod +x init.rb
# This should include the trailing slash
DEFAULT_ROOT = '/Users/dan/Sites/'
VHOST_FOLDER = '/etc/apache2/sites/'
@Samsinite
Samsinite / array.js
Created January 26, 2015 04:47
Array transform for ember-data
import Ember from 'ember';
import DS from 'ember-data';
export default DS.Transform.extend({
serialize: function(deserialized) {
return !!deserialized ? deserialized.toArray() : null;
},
deserialize: function(serialized) {
return Ember.A(serialized);