Skip to content

Instantly share code, notes, and snippets.

View git2samus's full-sized avatar

Michael Cetrulo git2samus

View GitHub Profile
Gem::Specification.new do |spec|
spec.name = 'readability'
spec.author = 'Michael Cetrulo'
spec.email = 'michael.cetrulo@toptal.com'
spec.version = '0.0.1'
spec.summary = 'Calculates several readability indices.'
spec.description = 'Readability indices or formulas attempt to represent an entire text with a single number that is representative of the comprehension level required for reading the given text.'
spec.files = ['lib/readability.rb',
'lib/readability/abbreviations.rb',
'lib/readability/syllables.rb',
from datetime import datetime, timedelta
last_seen = datetime.now()
while True:
serial_input = raw_input() # read from serial port
if serial_input == "[FIT]":
last_seen = datetime.now()
elif datetime.now() - last_seen >= timedelta(minutes=5):
@git2samus
git2samus / FBSuarezFilter.user.js
Created June 26, 2014 15:10
Facebook Suárez Filter
// ==UserScript==
// @name Facebook Suarez Filter
// @namespace git2samus
// @include https://www.facebook.com/*
// @match https://www.facebook.com/*
// ==/UserScript==
var suarez_re = /Su[aá]rez/i;
for (contentNode in document.getElementsByClassName('userContentWrapper')) {
>Rosalind_8980
CACCCCCTAAGTTAGACAGCTACAAGTCACTATGATTTTTTAGCTGCCTAGCACTATTGT
TTGAAACTCAGCGTCACACACAGCCAACATCTACCGGACGACCAGTTTTAATTCGTAAAG
ACGTGCGGGCTACTGTGATCTAATGTAACCGCACTCTCGCGGAACGCCTTTTGTCTCGGG
TCGGCCTATGTCCTTAGGAATGTCCGGTGAATTACAACTAAGAACGGCCTTGGTATCGCG
GGTACACCTGTCTATTTTGCATGGTGTGTGTTAACGGTGGCTGCGAGGGGACGAAATCAA
TGACCAAGGCAGGAAGTAGGTTAGCGGGCTAGTCGCACACTTTGTTGTCGGTCAAGTGAA
TACCCTCAGGACCTGTGCGGTTACGGGTCACGGGAGATCCGCGAAGCTGCCAATTGTATT
GACTTTGGCCACGGTATAGGTGTTCAGGTATCCTTGTCATCAACGATACCCTCAGGTCCT
TTGAGGCCTCTACTGCCTAGGTGTTAGGCGCATTTTCGCTGAGTCCTAAAACAGTATTAC
#!/bin/sh
USAGE="list | <types> ..."
LONG_USAGE="Generate/Append the repo's .gitignore file using the gitignore.io api
`curl -s http://gitignore.io/api/`"
SUBDIRECTORY_OK=
OPTIONS_SPEC=
. "$(git --exec-path)/git-sh-setup"
@git2samus
git2samus / vpnc-script
Created June 9, 2013 00:18
Ubuntu's default vpnc-script
#!/bin/sh
# List of parameters passed through environment
#* reason -- why this script was called, one of: pre-init connect disconnect
#* VPNGATEWAY -- vpn gateway address (always present)
#* TUNDEV -- tunnel device (always present)
#* INTERNAL_IP4_ADDRESS -- address (always present)
#* INTERNAL_IP4_MTU -- mtu (often unset)
#* INTERNAL_IP4_NETMASK -- netmask (often unset)
#* INTERNAL_IP4_NETMASKLEN -- netmask length (often unset)
#* INTERNAL_IP4_NETADDR -- address of network (only present if netmask is set)
@git2samus
git2samus / gist:4180379
Created December 1, 2012 03:08
improved version of local_settings
try:
execfile('local_settings.py')
except IOError:
pass
@git2samus
git2samus / gist:4180342
Created December 1, 2012 02:56
traditional local_settings approach
try:
from local_settings import *
except ImportError:
pass
@git2samus
git2samus / gist:3688073
Created September 10, 2012 00:18
helper for plaintext file edition in vim
fun! TextMode(mode) range
if a:mode == 'textmode'
setlocal filetype=text
setlocal wrap
setlocal nolist
setlocal linebreak
nnoremap <buffer> j gj
nnoremap <buffer> k gk
nnoremap <buffer> 0 g0
nnoremap <buffer> $ g$