Skip to content

Instantly share code, notes, and snippets.

View huertanix's full-sized avatar
💬
is typing

David Huerta huertanix

💬
is typing
View GitHub Profile
@embedly
embedly / simple_twitter_search.html
Created May 3, 2010 17:19
Simple example of Twitter Search with Embedly
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://scripts.embed.ly/jquery.embedly.js"></script></head>
<body>
<form action="" method="get"><input type="text" name="q"/><input type="submit" name="q" value="Search"/></form>
<ul></ul>
<script>
function searchTwitter(q){
//Force twitter to only search image providers
@lobster1234
lobster1234 / fabric_yammer.py
Created April 28, 2011 10:44
Fabric task to send build status to Yammer
import oauth2 as oauth
import urllib
def yam():
consumer_key = YOUR_CONSUMER_KEY
consumer_secret= YOUR_CONSUMER_SECRET
access_token = YOUR_ACCESS_TOKEN
access_token_secret = YOUR_ACCESS_TOKEN_SECRET
consumer = oauth.Consumer(consumer_key, consumer_secret)
token = oauth.Token(access_token,access_token_secret)
client = oauth.Client(consumer,token)
@pamelafox
pamelafox / queue.yaml
Created April 6, 2012 21:48
Geocoding with named task queue parameters on App Engine
queue:
- name: geocoding
rate: 1/m
retry_parameters:
task_retry_limit: 60
task_age_limit: 3d
min_backoff_seconds: 120
@matenia
matenia / post.rb
Created May 10, 2012 01:29
Use custom method for FriendlyId (Example)
class Post < ActiveRecord::Base
# for SO: http://stackoverflow.com/questions/10481389/friendly-id-with-two-parameters
# EXAMPLE ASSUMES YOU ARE USING FRIENDLYID 4.X
# AND THAT YOU HAVE A SLUG:STRING COLUMN ON THE MODEL
# ...
extend FriendlyId
friendly_id :generate_custom_slug, :use => :slugged
# ...
@mdobson
mdobson / CSVtoJSON.rb
Created July 8, 2012 15:51
Convert CSV to JSON with simple command line script
#!/usr/bin/env ruby
require 'json'
file = File.new(ARGV[0], "r")
#get format
puts "Getting format"
format = file.gets
@jordelver
jordelver / gist:3139365
Created July 18, 2012 22:29
How to write an image file to an SD card under Mac OS X (for Raspberry Pi)

Find the SD card device

In this case, the SD card is /dev/disk4. DO NOT get this wrong or you may destroy all the data on the wrong disk/card/drive.

diskutil list

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *160.0 GB   disk0

1: EFI 209.7 MB disk0s1

@bbrewer97202
bbrewer97202 / heroku-htaccess.md
Created August 10, 2012 18:20
Simple htaccess authentication on Heroku with cedar/php

Create an .htaccess file in the webroot:

AuthUserFile /app/www/.htpasswd
AuthType Basic
AuthName "Restricted Access"
Require valid-user

Create a .htpasswd file:

htpasswd -c /app/www/.htpasswd [username]

@codingjester
codingjester / three_legged_oauth.py
Last active December 9, 2018 02:34
Tumblr 3 Legged OAuth using Python lib OAuth2
import urlparse
import oauth2 as oauth
consumer_key = 'consumer_key'
consumer_secret = 'consumer_secret'
request_token_url = 'https://www.tumblr.com/oauth/request_token'
access_token_url = 'https://www.tumblr.com/oauth/access_token'
authorize_url = 'https://www.tumblr.com/oauth/authorize'
@cheeaun
cheeaun / putonglasses.txt
Created September 14, 2012 08:57
put on glasses unicode
•_•)
( •_•)>⌐■-■
(⌐■_■)
@brendandawes
brendandawes / Toy Rocket Construction Kit.scad
Last active April 11, 2018 02:40
OpenSCAD file for the Toy Rocket Construction Kit
/*
Toy Rocket Construction Kit by Brendan Dawes
brendandawes.com
Nose cone isn't great but it suffices for now!
*/
rocketRadius = 20;
connectorHeight = 5;