Skip to content

Instantly share code, notes, and snippets.

View miguelff's full-sized avatar

Miguel Fernández miguelff

View GitHub Profile

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’

@miguelff
miguelff / select_times.sh
Last active August 29, 2015 13:57
Grep the times spent by non-cached SQL queries from a log, you can the count it and sum it to get aggregate results of the queries done and the time spent by them
cat log/development.log|grep SELECT |grep -v CACHE | ruby -e "ARGF.each{|line| puts line.match(/(\d+\.\d+)ms/).captures rescue nil}"

Lo que quería decir es que en caso de polisemia, la connotación con la que se interpreta un término depende de nosotros mismos, pero lo que este denota depende del contexto en el que es aplicado.

Master/Slave es un término ampliamente aceptado para designar un concepto en sistemas de gestión de bases de datos, usaré la definición de la wikipedia:

"Master/slave is a model of communication where one device or process has unidirectional control over one or more other devices. In some systems a master is elected from a group of eligible devices, with the other devices acting in the role of slaves" - Wikipedia

Se pretende cambiarlo por ser ofensivo. Mi pregunta es, de la semántica del término ¿Qué parte es ofensiva?

De la semántica del término ninguna. Sólo es ofensivo en el momento en el que el término se asocia a otro contexto, i.e. se varía su semátnica aplicándola a otro escenario que no le corresponde, como a la exclavitud humana.

def obfuscated():
d=[0x20]*0x0D;o=0x61;
for x in [[7,11],2,[10,12],[1],[0],2,[3,9],2,[2],1,[6],7,[8],3,[4]]:
if hasattr(x, '__len__'):
for c in x:
d[c]=o
o=o+1
else:
o=o+x
return "".join(map(chr, d))
{
"_index" : "development_movida_titles",
"_type" : "title",
"_id" : "366615",
"_version" : 2,
"found" : true,
"_source":{"company_id":4,"external_id":null,"name":"Test Upload","tag":[],"metadata":[{"key":4890,"value":"0"},{"key":86,"value":"MYCAT"},{"key":87,"value":"MYDET"},{"key":88,"value":"LONG DESC"},{"key":89,"value":"MYCAT"},{"key":93,"value":"BOOM"}],"asset":["366615A","366615B","366615C"],"licensor":"Bebanjo"}
}
@miguelff
miguelff / gist:919277
Created April 14, 2011 11:12
mergesort java collections framework impl.
private static void sort(int start, int end, long[] array) {
long temp;
int length = end - start;
if (length < 7) {
for (int i = start + 1; i < end; i++) {
for (int j = i; j > start && array[j - 1] > array[j]; j--) {
temp = array[j];
array[j] = array[j - 1];
array[j - 1] = temp;
}
%%
%% wait_for_stream/2
%%
wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
?TRACE(undefined, "START: ~p", [Attrs]),
DefaultLang = case ?MYLANG of
undefined -> " xml:lang='en'";
DL -> " xml:lang='" ++ DL ++ "'"
end,
case xml:get_attr_s("xmlns:stream", Attrs) of
@miguelff
miguelff / gist:2634316
Created May 8, 2012 11:18
An script to grab some quick dirty stats of the aol query log
#!/usr/bin/env ruby
files = %w{aol015 aol026}.map{|f| f+".sessionized"}
sessions = {}
#load sessions hash
files.each do |f|
lines = File.open(f).each do |line|
if line.length > 10
sid, uid, q, *rest = line.split("\t")
if sessions.has_key? sid
@miguelff
miguelff / gist:2920479
Created June 12, 2012 22:20
Gente hablando en twitter desde Mieres, (Asturias) sobre los mineros.
require 'rubygems'
gem 'twitter'
gem 'geocoder'
class Hash
def to_url_params
elements = []
keys.size.times do |i|
elements << "#{keys[i]}=#{values[i]}"