Skip to content

Instantly share code, notes, and snippets.

View vhsalazar's full-sized avatar

Victor Salazar vhsalazar

  • Sydney, Australia
View GitHub Profile
@wblakecaldwell
wblakecaldwell / google_io_puzzle.py
Last active August 29, 2015 14:00
Google I/O secret invite code finder
#
# Google I/O 2014 secret invite code finder
#
# Blake Caldwell, 2014
#
# Blog Post: http://blakecaldwell.net/blog/2014/4/23/solving-a-2014-google-io-secret-invite-puzzle.html
#
# Repeatedly hit https://developers.google.com looking two-colored "I/O" on the page,
# with a secret code in comments below it. Using the color codes of the "I" and "O",
# calculate the 6-character Google URL-shortened link code, and print the code out.
@StuMx
StuMx / streamLoader.js
Created February 27, 2012 20:56
Twitter stream using javascript.
/*
* You have to include oauth.js and sha1.js from here http://oauth.googlecode.com/svn/code/javascript/
* /
var url = "https://userstream.twitter.com/2/user.json";
var accessor = {
token: "",
tokenSecret: "",
consumerKey : "",
consumerSecret: ""
@jameshartig
jameshartig / ioCrawler.go
Last active September 19, 2018 00:23
Google I/O 2014 redeem easter egg crawler
//before running make sure you setup a GOPATH env variable and ran: "go get code.google.com/p/go.net/html"
//to run: go run ioCrawler.go -url="http://developers.google.com/"
//also try http://developer.android.com/index.html
//output goo.gl links to try and redeem will be sent to foundLinks.txt
//by the way there's an artificial "rate limit" in func crawler, you can lower that or raise it as you wish
//You can also comment out the onlyGoogleRegex code if you don't want to limit to google.com/youtube
//if you're getting I/O timeout errors, then you might need to increase the timeouts on line 231
@mauforonda
mauforonda / bolivia_issues.json
Last active January 28, 2020 18:25
Usuarios bolivianos en Github con más issues abiertos. De los usuarios de Github que declaran ser de Bolivia (o cualquier departamento), selecciono los 1000 con más seguidores (no puedo avanzar más por limitaciones del api) y los ordeno por número de issues abiertos.
[
{
"user": "saldanac",
"issues": 2534
},
{
"user": "djimenezjerez",
"issues": 555
},
{
@Exlord
Exlord / RoutePrefix.js
Last active March 29, 2022 20:32
Add a global Prefix to all routes in Angular 1.3 router
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (needle) {
for (var i = 0; i < this.length; i++) {
if (this[i] === needle) {
return i;
}
}
return -1;
};
}
@amejiarosario
amejiarosario / rails_migration_cheatsheet.md
Created June 18, 2012 21:40
Rails Migration - Cheatsheet
@kyuden
kyuden / describe vs. context in rspec
Created February 8, 2014 20:27
describe vs. context in rspec
describe vs. context in rspec
http://lmws.net/describe-vs-context-in-rspec
In Rspec world, you often see people using both “describe” blocks and “context” blocks together, like this
describe "launch the rocket" do
context "all ready" do
end
context "not ready" do
@gerryster
gerryster / us_geo_chart_google
Created December 8, 2012 23:13
US State Map using the GeoChart from the Google Chart Tools
// GeoChart from https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart
// Try out by pasting code into: https://code.google.com/apis/ajax/playground/?type=visualization#geo_chart
function drawVisualization() {
var data = google.visualization.arrayToDataTable([
['State', 'Foo Factor'],
['US-IL', 200],
['US-IN', 300],
['US-IA', 20],
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active April 19, 2024 04:06
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias