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
readFromDatabase(function(data) { | |
printData(data); | |
}) | |
doSomethingUnrelatedLikeFetchingSomethingElse(); |
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
$.ajax({ | |
url: '/path/to/file', | |
type: 'POST', | |
dataType: 'json', | |
data: {param1: 'value1'}, | |
complete: function(xhr, textStatus) { | |
doSomethingOnComplete(); | |
}, | |
success: function(data, textStatus, xhr) { | |
doSomethingOnSuccess(); |
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 standard system and HTTP libraries | |
var sys = require('sys'), | |
http = require('http'); | |
// Create an HTTP server listening on port 8000 and attach a function to handle incoming requests | |
http.createServer(function (request, response) { | |
//Set response headers | |
response.writeHead(200, {'Content-Type': 'text/plain'}); | |
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
hydra:~ jpadilla$ sudo curl https://github.com/atmos/cinderella/raw/master/bootstrap.sh \ | |
> -o - | sh | |
Password: | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
102 1333 102 1333 0 0 1722 0 --:--:-- --:--:-- --:--:-- 12695 | |
Ensuring we have the latest version of cinderella installed | |
A first time install takes about 45 minutes on a modern machine | |
Cinderella installed successfully | |
[Sun, 21 Nov 2010 11:50:39 -0400] INFO: Setting the run_list to ["homebrew", "homebrew::dbs", "homebrew::misc", "ruby", "ruby::irbrc", "node", "python"] from JSON |
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
mysql -uUSER -pPASSWORD | |
mysql> source /home/jpadilla/dump001.sql |
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
// Scraping Made Easy with jQuery and SelectorGadget | |
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga) | |
// by David Trejo | |
// | |
// Install node.js and npm: | |
// http://joyeur.com/2010/12/10/installing-node-and-npm/ | |
// Then run | |
// npm install jsdom jquery http-agent | |
// node numresults.js | |
// |
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
set @primary_key := 0; | |
UPDATE `table_name` SET `id` = @primary_key := @primary_key + 1 ORDER BY `id`; |
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
# SupperfeedrPshb | |
require 'httparty' | |
module SuperfeedrPshb | |
class SuperfeedrPshb | |
include HTTParty | |
attr_accessor :hub, :auth, :callback_root | |
base_uri nil | |
def initialize(username, password, callback_root, hub = "http://superfeedr.com/hubbub") |
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 | |
# To run do: curl https://theurl.com/bootstrap.sh | bash && source ~/.profile | |
# | |
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10 | |
# This script must install the following requirements | |
# * apache2 | |
# * mod_wsgi | |
# * mysql | |
# * pip |
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 | |
# To run do: | |
# wget http://url.com/bootstrap.sh && chmod +x bootstrap.sh && ./bootstrap.sh && source ~/.profile | |
# | |
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10 | |
# This script will: | |
# * install/config apache2 | |
# * install mod_wsgi | |
# * install/config nginx |