🏳️🌈
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
var socket = io.connect("http://myserver"); | |
socket.on("*", function(){ | |
// listen to any and all events that are emitted from the | |
// socket.io back-end server, and handle them here. | |
// is this possible? how can i do this? | |
}); |
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
haml_file = "path/to/my/filename.haml" | |
haml_data = File.read(haml_file) | |
result = Haml::Engine.new(haml_data).render |
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
<form action="/login" id="login-form"> | |
Username: <input type="text" id="username"><br> | |
Password: <input type="password" id="password"><br> | |
<button id="login" disabled="true">Login</button> | |
</form> |
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
var one = value(1); | |
var two = value(2); | |
var three = value(3); | |
var four = value(4); | |
// (1 + 2) * 3 - 4 == 5 | |
var added = add(one, two) | |
var multiplied = multiply(added, three) | |
var resultFunc = subtract(multiplied, four); |
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
module Capybara | |
class Session | |
def has_image?(src) | |
has_xpath?("//img[contains(@src,\"/images/#{src}\")]") | |
end | |
end | |
end |
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
MyRouter = Backbone.Router.extend({ | |
routes: { | |
"": "mail", | |
"inbox": "mail", | |
"inbox/categories/:category": "mailCategory", | |
"inbox/:id": "mailMessage" | |
}, | |
mail: function(){ | |
BBCloneMail.MailApp.show(); |
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
var SomeModel = Backbone.Model.extend({}); | |
someModel = new SomeModel(); | |
someModel.bind("change", function(model, collection){ | |
alert("You set some_attribute to " + model.get('some_attribute')); | |
}); | |
someModel.set({some_attribute: "some value"}); |
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
function gitup { | |
# set defaults for all options | |
GITUP_MERGE_COMMAND=rebase | |
GITUP_BRANCH_NAME=development | |
GITUP_REMOTE_NAME=origin | |
GITUP_SKIP_UPDATE=0 | |
GITUP_SKIP_MIGRATIONS=0 | |
# load user level settings as overrides | |
local user_config_file="$(echo ~/.gituprc)" |
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
# Gitup: Git Update Dance Configuration | |
# ------------------------------------- | |
# configuration for gitup can be set as a default for the current user | |
# by adding a ~/.gituprc file with settings | |
# | |
# current project or local directory settings can be added in ./.gituprc | |
# | |
# the .gituprc file is a valid shell script, loaded every time gitup is | |
# run. this means you can add logic, functions, and other calls to the | |
# .gituprc file and it will be executed at runtime |
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
// set up your oracle stuff ... | |
function runIt(cb){ | |
// connection and other setup here | |
var bindvars = { | |
o_cursor: { | |
type: oracledb.CURSOR, |
NewerOlder