Attention: if you attempt to fork this gist, github will think that you are a spammer and you will have to confirm that you are human with them. Apparantly there are too many links in this list. Also I update it rather frequently (see revisions on the left), so it's probably wise to not fork it anyway.
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
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>POST</AllowedMethod> | |
<AllowedMethod>PUT</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> | |
<AllowedHeader>*</AllowedHeader> | |
</CORSRule> |
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
# Directories | |
alias ..='cd ..' | |
alias cdd="cd -" | |
# Git | |
alias g='git status' | |
alias ga='git add -A' | |
alias gc='git commit -a -s' | |
alias gcb='git checkout -b' # Check out a new branch | |
alias hack='bash ~/hack.sh' # Hack on the branch |
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 cheerio = require('cheerio') | |
, Shred = require('shred') | |
, shred = new Shred() | |
, http = require('http') | |
, URL = require('url'); | |
var server = http.createServer(function(request, response) { | |
var url, urlToDiscover; | |
url = URL.parse(request.url, 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
cheerio = require('cheerio') | |
Shred = require('shred') | |
shred = new Shred() | |
http = require('http') | |
URL = require('url') | |
server = http.createServer (request, response) -> | |
url = URL.parse(request.url, true) | |
urlToDiscover = url.query['url'] | |
startDiscovery urlToDiscover, (theImageURL) -> |
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
HTTP defines a bunch of meaningful status codes that can be returned from your API. These can be leveraged to help the API consumers route their responses accordingly. I've curated a short list of the ones that you definitely should be using: | |
* 200 OK - Response to a successful GET, PUT, PATCH or DELETE. Can also be used for a POST that doesn't result in a creation. | |
* 201 Created - Response to a POST that results in a creation. Should be combined with a Location header * pointing to the location of the new resource | |
* 204 No Content - Response to a successful request that won't be returning a body (like a DELETE request) | |
* 304 Not Modified - Used when HTTP caching headers are in play | |
* 400 Bad Request - The request is malformed, such as if the body does not parse | |
* 401 Unauthorized - When no or invalid authentication details are provided. Also useful to trigger an auth * popup if the API is used from a browser | |
* 403 Forbidden - When authentication succeeded but authenticated user doesn't have access to the re |
The share links are much better than share buttons. Because Share button need script to be loaded and also track our web pages to find number of shares or tweets. If you dont want complex script loading and share count. You can go ahead with simple share links.
For Facebook, you just need to add this link in everyone of your posts.
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 _ = require('underscore'), | |
rabbit = require('rabbit-pool'), | |
logging = require('logging')(module); | |
var exchange, | |
handlers = {}, | |
messages = []; |
In this episode, Jay McGavren shares some of his favorite tricks for working in the shell. No unreadable sed or awk scripts here. Just simple, solid tips you can use every day, including time savers with find, less, ssh, and command-line Ruby.
http://programmer.97things.oreilly.com/wiki/index.php/The_Unix_Tools_Are_Your_Friends
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/bash | |
#Force file syncronization and lock writes | |
mongo admin --eval "printjson(db.fsyncLock())" | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
MONGO_HOST="prod.example.com" | |
MONGO_PORT="27017" | |
MONGO_DATABASE="dbname" | |