Skip to content

Instantly share code, notes, and snippets.

View miguelff's full-sized avatar

Miguel Fernández miguelff

View GitHub Profile
{
"_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"}
}
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))

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.

@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}"

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’

Simplistic Full-Text Search With Redis's Sorted Sets

Howto

git clone git://gist.github.com/923934.git redisearch

cd redisearch
# see: http://weblog.therealadam.com/2011/02/12/simple-ruby-pleasures/comment-page-1/#comment-315
class QueryTracer < ActiveSupport::LogSubscriber
ACCEPT = %r{^(app|config|lib)}.freeze
FRAMES = 5
THRESHOLD = 300 # In ms
def sql(event)
return unless event.duration > THRESHOLD
# With thanks to https://github.com/optoro/activerecord-callback_notification for original inspiration
if Rails.env.development?
module ActiveRecord
module CallbackNotifications
extend ActiveSupport::Concern
module ClassMethods
def notify_all_callbacks
# Make sure all models are loaded before trying to enumerate
@miguelff
miguelff / romans.py
Created October 6, 2013 00:39
Roman numerals in python
#!/usr/bin/env python
# encoding: utf-8
"""
romans.py
Convert integer to roman numerals back and forth
Created by Miguel Fernández on 2013-10-06.
"""
class Romans:
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################