TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.
import Ember from "ember"; | |
export default Ember.Component.extend({ | |
active: false, | |
slideshow: null, | |
init: function() { | |
this._super(); |
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 |
// 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"); |
class AppDelegate | |
def applicationDidFinishLaunching(notification) | |
MainMenu.build! | |
MainMenu[:app].subscribe :quit do |_| | |
NSApp.terminate(self) | |
end | |
MainMenu[:file].subscribe :new do |_| |
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: