Skip to content

Instantly share code, notes, and snippets.

Dan Zajdband impronunciable

View GitHub Profile
View gist:1257799
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc,char *argv[]) {
int charcount = 0;
float timecount = 0; /* number of characters seen */
FILE *in_file; /* input file */
View gist:1404821
$(document).ready(function(){
$('#s,label[for=s]').hide();
var sel_list = $('<div id="sel_list"><strong><span></span></strong><ul></ul></div>');
sel_list.find('span').text($('label[for=s]').text());
$('#s').children('option').each(function(){
sel_list.children('ul').append('<li>' + $(this).text() + '</li>');
});
$('#s').after(sel_list);
View gist:1444483
$('#peron').click(function(e){
e.preventDefault();
$('#ul1 li').each(function(){
var img = $('<img />');
img.attr('src', $(this).attr('href' );
$(this).before(img);
$(this).remove();
});
});
View gist:1444517
$('#peron').click(function(e){
e.preventDefault();
$('#ul1 li a').each(function(){
var img = $('<img />');
$(img).attr('src', $(this).attr('href'));
$(this).before(img);
$(this).remove();
});
});
View gist:1705550
'POST /api/v1/user/ HTTP/1.1\r\nContent-Type: application/json\r\nAccept: application/json\r\nContent-Length: 121\r\nHost: 127.0.0.1:8000\r\nConnection: keep-alive\r\n\r\n{"method":"facebook","method_id":"123123213123","username":"REPTARRRR","name":"Aventuras en pañales","password":"123456"}'
View gist:1724963
;(function ( $, window, document, undefined ) {
var defaults = {
start: 0
, update_interval: 2000
, stop: false
, stop_at: 600000
, min_count: 1
, max_count: 5
};
View select-to-dropdown.js
var select_to_dropdown = function(el, dropdown, select_text ){
$(el).children().hide();
var sel_list = $('<div id="'+dropdown+'"><strong class="cta"><span></span></strong><ul></ul></div>');
sel_list.find('span').text($(el + ' label').text());
$(el + ' select').children('option').each(function(){
sel_list.children('ul').append('<li>' + $(this).text() + '</li>');
});
$(el).append(sel_list);
$(dropdown).find('li').live('click',function(e){
$(el + ' select option').eq($(this).index()).attr('selected','selected').siblings('option').removeAttr('selected');
View givememoney.js
var Tuiter = require('tuiter')
, redis = require('redis');
var t = new Tuiter({
"consumer_key" : "your consumer key"
, "consumer_secret" : "your consumer secret"
, "access_token_key" : "your access token key"
, "access_token_secret" : "your access token secret"
});
@impronunciable
impronunciable / givememoney.js
Created May 3, 2012
The way every web developer should ask for a raise
View givememoney.js
var redis = require('redis')
, Tuiter = require('tuiter');
var client = redis.createClient();
// your twitter api credentials
var t = new Tuiter({
"consumer_key" : "blablabla"
, "consumer_secret" : "blablabla"
, "access_token_key" : "blablabla"
View gist:3965177
var tuiter = require('tuiter')(keys);
var getTweets = function(screen_name, max_id) {
tuiter.userTimeline({screen_name: screen_name, max_id: max_id}, function(err, tweets){
//save tweets
//get more
if(tweets.length)
getTweets(screen_name, tweets[tweets.length - 1].id - 1);
You can’t perform that action at this time.