Skip to content

Instantly share code, notes, and snippets.

View yeco's full-sized avatar

Jasson Cascante yeco

View GitHub Profile
curl -d 'track=bot' http://stream.twitter.com/track.json -ubotcualquiera:botpass > tweets.json 2> /dev/null & tail -f tweets.json | while read tweet; do echo $tweet | grep -E -o '"screen_name":"[[:alnum:]]+"' | cut -d '"' -f 4 | while read screen_name; do echo "siguiendo a: $screen_name"; curl -d '' http://twitter.com/friendships/create/$screen_name.json?follow=true -ubotcualquiera:botpass; done ; done
curl -d 'track=one line' http://stream.twitter.com/track.json -ubotcualquiera:botpass > tweets.json 2> /dev/null & tail -f tweets.json | \
while read tweet; do echo $tweet | \
grep -E -o '"screen_name":"[[:alnum:]]+"' | cut -d '"' -f 4 | while read screen_name; do \
echo "following: $screen_name"; curl -d '' http://twitter.com/friendships/create/$screen_name.json?follow=true -ubotcualquiera:botpass; \
done ; \
done
function getTextValue(n)
{
var s = '';
for (var c=0;c<n.childNodes.length;c++)
{
s+=n.childNodes[c].nodeValue;
}
return s;
}
function getElementsInRegion(x, y, width, height) {
var elements = [],
expando = +new Date,
cx = x,
cy = y,
curEl;
height = y + height;
width = x + width;
jQuery.easing.flicker = function(p, t, b, c) {
// p = progression: between 0 and 1
// t = current time
// b = beginning value
// c = change in value
return (Math.random() > .5 ? p : 1) * c + b;
};
// See the demo: http://jsbin.com/ihama
/*
Daaaaatabase
Allows the use of multiple database types using one class
*/
class Database
{
var $mInsertId; // holds last insert id. Only applies to MySQL
var $mQueries = array(); // holds all queries
var cookieHandler = {
set: function (name, value, hours, path) {
var expires = this.getHoursFromNow(24);
if (hours) expires = this.getHoursFromNow(hours);
path = path || '/';
document.cookie = name +'='+ escape(value) +'; expires='+ expires+'; path='+ path;
},
getHoursFromNow: function (hours) {
return new Date(new Date().getTime() + hours * 3600000);
/* ************************************************************************
sLoad - a chainable lazy loader
License:
MIT: http://www.opensource.org/licenses/mit-license.php
Authors:
* Yëco (http://elBleg.com)
@yeco
yeco / wtf.js
Created February 12, 2010 21:54
0.1 + 0.2 //0.30000000000000004
0.1 + 0.2 === 0.3 //false