- Click Plus
- New Repository
- IR/
REPO_NAME
PROJECT_DESCRIPTION
- Do not initialize with anything (easier to add after)
- Star your repo
- Pull your repo down locally and
cd
to it
This file contains 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({ | |
active: false, | |
slideshow: null, | |
init: function() { | |
this._super(); |
This file contains 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
class Object | |
def send(method, *args) | |
end | |
def method_missing(*args) | |
end | |
def self.method_added(method_name) | |
remove_method(method_name) | |
end |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
This file contains 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
class AppDelegate | |
def applicationDidFinishLaunching(notification) | |
MainMenu.build! | |
MainMenu[:app].subscribe :quit do |_| | |
NSApp.terminate(self) | |
end | |
MainMenu[:file].subscribe :new do |_| |
This file contains 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
// This is just an example of nested callbacks. I know you could achieve this | |
// goal with simpler code but I'm just showing an example | |
// The well-known callback pattern | |
fs.mkdir("some-path", function(err) { | |
fs.open("some-path/file", "w", function(err, fd) { | |
var buffer = new Buffer("hello world"); | |
fs.write(fd, buffer, 0, buffer.length, null, function(err, bytes) { | |
console.log("Wrote " + bytes + " bytes"); |
This file contains 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
def pretty_inspect(object, indent = 2) | |
if object.is_a?(Array) | |
entries = object.collect{|x| "#{pretty_inspect x, indent + 2}"} | |
pretty_indent entries, "[", "]", indent | |
elsif object.is_a?(Hash) | |
entries = object.keys.sort.collect{|x| "#{pretty_inspect x} => #{pretty_inspect object[x], indent + 2}"} | |
pretty_indent entries, "{", "}", indent | |
else | |
object.inspect | |
end |