Skip to content

Instantly share code, notes, and snippets.

View tumblr_guidelines.md

As a global platform for creativity and self-expression, Tumblr is deeply committed to supporting and protecting freedom of speech. At the same time, we draw lines around a few narrowly defined but deeply important categories of content and behavior that jeopardize our users, threaten our infrastructure, and damage our community.

What Tumblr is for:

Tumblr celebrates creativity. We want you to express yourself freely and use Tumblr to reflect who you are, and what you love, think, and stand for. What Tumblr is not for:

  • Malicious Speech. Don't encourage violence or hatred on the basis of things like race, ethnic origin, religion, disability, gender, age, veteran status, or sexual orientation. We encourage you to dismantle negative speech through argument rather than censorship. We will, however, remove anything that is overtly malicious.

  • Harm to Minors. Be thoughtful when posting anything involving a minor. Don't post or solicit anything relating to minors that is sexually suggestive or violent. Don’

View simone.md

At the bottom of the heart of every human… there is something that goes on indomitably expecting, in the teeth of all experience of crimes committed, suffered, and witnessed, that good and not evil will be done to him. It is this above all that is sacred in every human being.

Simone Weil

@aitor
aitor / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:8002
require 'net/http'
class Object
def method_missing(methId)
suggestion = Net::HTTP.get('search.yahooapis.com', "/WebSearchService/V1/spellingSuggestion?appid=YahooDemo&query=#{methId.to_s}")
method = /<Result>(.*)<\/Result>/.match(suggestion)
if method
puts "#{method[1]} bloody bastard, is ****#{method[1].upcase}****, not #{methId}... read the fucking docs!!!"
self.send method[1]
else
puts "what the hell '#{methId}' is bloody bastard?... read the fucking docs!!!"
@aitor
aitor / gist:9404
Created Sep 8, 2008
Fake community
View gist:9404
require 'faker'
require 'colored'
class Object
def tap
yield self
self
end
end
class Percentage
View copy to clipboard from a web page
//
// copied from: http://www.tek-tips.com/viewthread.cfm?qid=1465395&page=5
// TODO: reference original author...
//
function copy(rubyurl) {
var flashcopier = 'flashcopier';
if(!document.getElementById(flashcopier)) {
var divholder = document.createElement('div');
divholder.id = flashcopier;
document.body.appendChild(divholder);
View copy to clipboard from a web page.js
//
// copied from: http://www.tek-tips.com/viewthread.cfm?qid=1465395&page=5
// TODO: reference original author...
//
function copy(rubyurl) {
var flashcopier = 'flashcopier';
if(!document.getElementById(flashcopier)) {
var divholder = document.createElement('div');
divholder.id = flashcopier;
document.body.appendChild(divholder);
View gist:11048
setup do
@margie = Factory(:user, :login => 'm.thatcher')
@jaiku = Factory(:jaiku, :content => "To solve Britain’s economic Disease with Socialism is like treating leukaemia with leeches.", :user => @margie)
@activity = @jaiku.activities.first
end
should 'link the activities created on a model with the user that is generating the activity' do
assert_equal @margie, @activity.user, "The activity should be registered as made by the user that create the jaiku"
end
View gist:14592
require 'rubygems'
require 'hpricot'
require 'open-uri'
# el de Ara t. Howard no el de facets.
require 'openobject'
def scrap(element, id)
img = element.search("/img").first
paragraph = element.search("/p").first