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
#!/usr/bin/env node | |
var json = '' | |
process.stdin.on('readable', function(chunk) { | |
var chunk = process.stdin.read(); | |
json += chunk | |
if (chunk !== null) { | |
var r = JSON.parse(json) | |
r = JSON.stringify(r, null, ' '); | |
console.log(r); |
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 | |
GIT='git' | |
if test `uname` = "Darwin" ; then | |
SED_OPT='-E' | |
OPEN='open' | |
else | |
SED_OPT='-r' | |
OPEN='' |
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
us_top_100_sites = %w( | |
http://google.com/ http://facebook.com/ http://youtube.com/ http://yahoo.com/ http://amazon.com/ | |
http://wikipedia.org/ http://linkedin.com/ http://ebay.com/ http://twitter.com/ http://craigslist.org/ | |
http://bing.com/ http://pinterest.com/ http://blogspot.com/ http://live.com/ http://go.com/ | |
http://instagram.com/ http://cnn.com/ http://paypal.com/ http://tumblr.com/ http://reddit.com/ | |
http://imgur.com/ http://espn.go.com/ http://huffingtonpost.com/ http://wordpress.com/ http://netflix.com/ | |
http://yelp.com/ http://msn.com/ http://apple.com/ http://imdb.com/ http://weather.com/ | |
http://aol.com/ http://microsoft.com/ http://chase.com/ http://nytimes.com/ http://bankofamerica.com/ | |
http://godaddy.com/ http://zillow.com/ http://buzzfeed.com/ http://about.com/ http://walmart.com/ | |
http://foxnews.com/ http://secureserver.net/ http://ask.com/ http://wellsfargo.com/ |
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
if ($this->posts[0]->tumblr_url) { | |
header( "Location: " . $this->posts[0]->tumblr_url, true, 301); | |
exit; | |
} | |
} | |
// Put sticky posts at the top of the posts array | |
"wp-includes/query.php" 4399 lines --76%-- |
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
#!/usr/bin/env coffee | |
# | |
JiraApi = require('jira').JiraApi | |
#process = require 'process' | |
exec = require('child_process').exec | |
if process.argv.length < 1 + 2 | |
console.log "usage: ticketmachine sumamry [description]" | |
return 1 | |
[summary, description] = process.argv.slice 2 |
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
require 'sqwiggle-ruby' | |
require 'net/http' | |
require 'nokogiri' | |
require 'uri' | |
token = 'cli_be6cd40b6ebd25101b3450e34882412b' | |
flickr_rss = 'https://www.flickr.com/services/feeds/photos_public.gne?id=59591873@N00&lang=en-us' | |
uri = URI.parse(flickr_rss) |
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
source 'https://rubygems.org' | |
gem 'selenium-webdriver' |
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
#!/usr/bin/env ruby | |
#run in RAILS_ROOT directory | |
require 'json' | |
require 'yaml' | |
# http://stackoverflow.com/questions/9381553/ruby-merge-nested-hash | |
class ::Hash | |
def deep_merge(second) | |
merger = proc { |key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 } |
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://gist.github.com/18326 | |
// | |
// Copyright (c) KUMAGAI Kentaro ku0522a*gmail.com | |
// All rights reserved. | |
// | |
// | |
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
// | |
// |
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
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <zlib.h> | |
#define BFSIZE (32 * 1024) | |
OlderNewer