Skip to content

Instantly share code, notes, and snippets.

usage: ./troll.rb <your@mail> <password> <from@mail>
sample output:
Kuba,
Kolejnośc preferowana
Bardzo fajny tutorial, wprowadzenie na początek:.
http://www.ocaml-tutorial.org/
var u = require('underscore');
var object = {
varun: {
curry: {
rice: {
dan: "green"
}
}
}
requester.get("http://pudelek.pl", {}, function(window){
var headings = [];
window.$(".entry").each(function(i, e){
var el = window.$(e).find(".header h3 a");
headings.push({href: el.attr('href'), title: el.text()} );
});
Python 2.7.2 (default, Jan 23 2012, 23:13:33)
[GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.10.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ar = [1,2,3]
>>> ar
[1, 2, 3]
>>> ar[:-1]
[1, 2]
>>> ar[-1]
3
require("should")
class ContentTypeValidator
constructor: (whitelist = ['text/plain']) ->
@whitelist = []
for content_type in whitelist
@whitelist.push(content_type.toLowerCase())
@JakubOboza
JakubOboza / gist:1788925
Created February 10, 2012 11:33
guts out
var site_url = 'http://www.pudelek.pl/';
var default_headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-us,en;q=0.5',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Cache-Control': 'max-age=0'
};
@JakubOboza
JakubOboza / request post node.js
Created February 10, 2012 00:01 — forked from alessioalex/request post node.js
request post node.js
var request = require('request'), default_headers, site_root = 'http://localhost:3000';;
default_headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-us,en;q=0.5',
'Accept-Encoding': 'gzip, deflate',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
// 'Connection': 'keep-alive',
'Cache-Control': 'max-age=0'
@JakubOboza
JakubOboza / gist:1780601
Created February 9, 2012 15:11
gravatar link generator
#!/usr/bin/env node
var email = process.argv[2];
var crypto = require('crypto');
function trim (str) {
var str = str.replace(/^\s\s*/, ''),
ws = /\s/,
i = str.length;
while (ws.test(str.charAt(--i)));
console.log("Oh hai")
function not_retarded_fib(n){
if(n < 3){
return 1;
}
var learn_dynamic_programming = [1,1];
for (var i = 2; i <= n; i++){
learn_dynamic_programming[i] = learn_dynamic_programming[i - 1] + learn_dynamic_programming[i - 2];
~/magellano/current$ bundle exec rake db:migrate --trace
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/json-1.6.1.gemspec]: invalid date format in specification: "2011-09-18 00:00:00.000000000Z"
Importer needs env to startup
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `each' for nil:NilClass
/home/vagrant/magellano/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.0/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb:68:in `register_javascript_expansion'
/home/vagrant/magellano/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.0/lib/action_view/railtie.rb:21:in `block (2 levels) in <class:Railtie>'