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
<!-- snippet of loading indicator --> | |
<div data-bind="if: loading().length"> | |
<div class="alert alert-info"> | |
Loading... | |
</div> | |
</div> | |
<!---- snippet of binding countries and languages dropdowns to Knockout.js model. --> |
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 UserModel = function () { | |
var self = this; | |
// Somewhat sophisticated loading flag that supports parallel loading of multiple endpoints. | |
self.loading = ko.observableArray(); | |
// Encapsulating the entire form in a property, so we can use ko.mapping in a safe way. | |
// If properties were directly on the model, we'd have to re-init model every time we | |
// load data, which could lead to unwanted consequences. | |
self.user = ko.observable(); |
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 goes into ~/.tm_properties | |
# For mor configuration options of things not exposed through the menu in TM Alpha: | |
# http://blog.macromates.com/2011/git-style-configuration/ and: | |
# https://gist.github.com/1478685#gistcomment-69755 | |
tabSize = 2 | |
showInvisibles = true | |
softTabs = true |
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
<!-- Activate responsiveness in the "child" page --> | |
<script src="/js/responsiveiframe.js"></script> | |
<script> | |
var ir = responsiveIframe(); | |
ir.allowResponsiveEmbedding(); | |
</script> | |
<!-- Corresponding code in the "parent" page --> | |
<script src="/js/jquery.js"></script> | |
<script src="/js/responsiveiframe.js"></script> |
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
#!/bin/sh | |
# ------------------------------------------------------------------------------ | |
# SOME INFOS : fairly standard (debian) init script. | |
# Note that node doesn't create a PID file (hence --make-pidfile) | |
# has to be run in the background (hence --background) | |
# and NOT as root (hence --chuid) | |
# | |
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
# INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
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 disable_notifications! | |
auth_url = "https://twitter.com/login" | |
notifications_url = "https://twitter.com/settings/notifications" | |
agent = Mechanize.new | |
page = agent.get(auth_url) | |
puts "DISABLING NOTIFICATIONS for #{self.username}" | |
puts "Logging in..." | |
page.forms_with(:action => 'https://twitter.com/sessions') do |forms| |
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 url = "http://cdn1.giltcdn.com/images/share/uploads/0000/0001/7250/172502872/420x560.jpg"; | |
var encoded = new Buffer(url).toString('base64'); | |
var decoded = new Buffer(encoded, 'base64').toString('ascii') | |
console.log(encoded); | |
console.log(decoded); |
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
{ | |
"glossary": { | |
"title": "example glossary", | |
"GlossDiv": { | |
"title": "S", | |
"GlossList": { | |
"GlossEntry": { | |
"ID": "SGML", | |
"SortAs": "SGML", | |
"GlossTerm": "Standard Generalized Markup Language", |
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
Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no |
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
/** | |
Some relevant links along the way: | |
https://github.com/joyent/node/issues/2809 | |
https://github.com/joyent/node/issues/877 | |
**/ | |
var http = require('http'); |