Skip to content

Instantly share code, notes, and snippets.

View atorralb's full-sized avatar
🎯
Focusing

Angel T. Durán atorralb

🎯
Focusing
View GitHub Profile
@kirbysayshi
kirbysayshi / StreamConsumer.js
Created June 10, 2011 22:25
consume twitter's public firehose using nodejs
var events = require('events')
,util = require('util')
,_ = require('underscore')
,http = require('http')
function StreamConsumer(options){
events.EventEmitter.call(this);
this.reEot = /.+\r\n/gm;
this.req = null;
@mariuz
mariuz / scroll_twitter.js
Created August 3, 2012 14:06
make a full picture of carmack tweets
var page = require('webpage').create();
page.open('http://twitter.com/ID_AA_Carmack', function (status) {
if (status !== 'success') {
console.log('Unable to access network');
} else {
var hitRockBottom = false;
while (!hitRockBottom) {
//scroll the page (not sure if this is the best way to do so...)
@TJkrusinski
TJkrusinski / client.js
Last active November 24, 2016 23:22
Twitter Love/Hate for stack overflow.
$(function(){
var socket = io.connect('http://localhost:8080');
socket.on('tweet', function(tweet) {
$('body').append('<div class="tweet">' + tweet.text + '</div>');
});
});
@rcarmo
rcarmo / archive.txt
Created March 18, 2016 23:07
Epic Commits from @dramalho
061997d DELEGATE ALL THE THINGS
092aa231f wait, wrong place
09e7fd3 RERECORD ALL THE THINGS!!!
0c27fb3 yeah, fix things will ya
0f4549133 New ascii art task (\!important stuff) , and a few DAO tweaks (mino...
12aa7ef34 LE NONNNNNN LE MADNESS
13233e7 Less PHP
154c535 Once more, now with feeling and a proper master head
184e754 Dear Past-Friday David :Remember the textarea that seemed totally random and misterioys? It was $.ajax... obviously
19a8700 MAKE IT BIGGER
@kkdd
kkdd / connected_components.js
Last active May 31, 2019 10:11
グラフの連結成分(JavaScript版) ref: https://qiita.com/kkdd/items/fce83a4fc3081378bc23
var graph = {"0": ["1", "2", "3"], "1": ["2"], "2": [], "3": ["4", "6"], "4": [], "5": ["7"], "6": [], "7": []};
// 0
// / | \
// 1--2 3
// | \
// 4 6
// 5--7
function connected_components(graph) {
var seen = [], push = Array.prototype.push;
@Antelox
Antelox / RAA_Ransom_beautified.js
Created June 14, 2016 13:09
Beautified Javascript code of the RAA Ransomware
var CryptoJS = CryptoJS || function(u, p) {
var d = {},
l = d.lib = {},
s = function() {},
t = l.Base = {
extend: function(a) {
s.prototype = this;
var c = new s;
a && c.mixIn(a);
c.hasOwnProperty("init") || (c.init = function() {
@obscuresec
obscuresec / dirtywebserver.ps1
Created May 18, 2014 15:36
Dirty PowerShell Webserver
$Hso = New-Object Net.HttpListener
$Hso.Prefixes.Add("http://+:8000/")
$Hso.Start()
While ($Hso.IsListening) {
$HC = $Hso.GetContext()
$HRes = $HC.Response
$HRes.Headers.Add("Content-Type","text/plain")
$Buf = [Text.Encoding]::UTF8.GetBytes((GC (Join-Path $Pwd ($HC.Request).RawUrl)))
$HRes.ContentLength64 = $Buf.Length
$HRes.OutputStream.Write($Buf,0,$Buf.Length)
@ryanmcgrath
ryanmcgrath / twitter_streaming.js
Created February 18, 2011 08:02
Access the Twitter Streaming API with ease (Node.js).
var util = require('util'),
http = require('http'),
events = require('events');
var Twitter = function(opts) {
this.username = opts.username;
this.password = opts.password;
this.track = opts.track;
this.data = '';
};
#!/usr/bin/env python
"""
Converts Internet Explorer 'capture network traffic' XML to a HAR file.
Turns out that XML is just a HAR file anyways, but in XML form. So this
just converts it to JSON, and Bob's your uncle.
Requires Python 2.7+ and LXML.
"""
from __future__ import unicode_literals
@kingschnulli
kingschnulli / SVGText.js
Created June 18, 2013 13:26
SVGText for fabric.js
fabric.SVGText = fabric.util.createClass(fabric.Object, {
type :'text-block',
text :'',
fontSize :14,
color :undefined,
lineColors :undefined,
selectedLine:0,
realWidth :0,
realHeight :0,