This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#inital setup for ubuntu 14.04 digital ocean droplet | |
#creates a new sudo user, copies root authorized keys file to user | |
#disables root and password logins | |
if [[ -z "$1" ]]; then | |
echo "You didn't enter a username!" | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BinarySearchTree() { | |
this.root = null; | |
this.size = 0; | |
} | |
BinarySearchTree.prototype = { | |
add: function(value) { | |
let node = {value: value}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Classic recursive array walk algorithm | |
var flatten = function(nestedArray, output) { | |
output = output || []; | |
var i = 0; | |
for (;i < nestedArray.length; i++) { | |
if (nestedArray[i] instanceof Array) { | |
flatten(nestedArray[i], output); | |
} else { | |
output.push(nestedArray[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const myMacro = () => | |
Ember.computed({ | |
get() { | |
return 'Ember Fiddle'; | |
}, | |
set(key, value) { | |
return value; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
myArrayOne: ['a', 'b', 'c', 'd'], | |
myArrayTwo: ['A', 'B', 'C', 'D'], | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const STATE = { | |
props: { | |
prop: true, | |
}, | |
}; | |
export default Ember.Component.extend({ | |
init() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
actions: { | |
doStuff() { | |
alert('did stuff'); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
actions: { | |
mutateProp() { | |
this.set('passedInProp', 'changed it everywhere!'); | |
} | |
} | |
}); |
OlderNewer