Skip to content

Instantly share code, notes, and snippets.

View paulodeleo's full-sized avatar

Paulo Henrique Deléo paulodeleo

  • Curitiba - PR, Brazil
View GitHub Profile
@filiptepper
filiptepper / rackup-kirk
Created March 8, 2011 11:02
start/stop/restart JRuby application running on Kirk
#! /bin/sh
set -u
NAME=<set your application name here>
DIRECTORY=<set your application directory here>
PIDFILE=/var/run/$NAME.pid
DAEMON="/usr/local/rvm/bin/rvm exec rackup"
DAEMON_ARGS="-s Kirk config.ru -p 3000 -P $PIDFILE"
@tracend
tracend / handlebars.gravatar.js
Created November 22, 2012 11:46
Handlebars.js - Gravatar thumbnail #handlebars #cc
// Handlebars.js - Gravatar thumbnail
// Usage: {{#gravatar email size="64"}}{{/gravatar}} [depends on md5.js]
// Author: Makis Tracend (@tracend)
Handlebars.registerHelper('gravatar', function(context, options) {
var email = context;
var size=( typeof(options.hash.size) === "undefined") ? 32 : options.hash.size;
return "http://www.gravatar.com/avatar/" + MD5( email ) + "?s="+ size;
});
@i-scorpion
i-scorpion / README.txt
Created June 18, 2012 12:24
Twitter bootstrap fixed table header using jQuery
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with following layout -
<table class="table-fixed-header">
<thead class="header">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
@shadowmaru
shadowmaru / slides.md
Last active November 26, 2020 07:17
Palestras da RubyConf BR 2017
@wjladams
wjladams / fixscroll.sh
Created April 9, 2018 21:03
xubuntu reverse scrolling
#!/bin/sh
# Find the amount by doign
# synclient | grep HorizScrollDelta
# synclient | grep VertScrollDelta
# And then simply negative that value for this
# Found at
# https://askubuntu.com/questions/690512/how-to-enable-natural-scrolling-in-xfce4/853262
# This is because, although xubuntu 18.04 has reverse scrolling option in touchpad
# settings, it doesn't really work, the setting does not cascade to gnome apps for some reason.
synclient HorizScrollDelta=-116
@hemenkapadia
hemenkapadia / Ubuntu 14.04 on Optimus Laptop.txt
Last active May 2, 2023 20:44
[Ubuntu 14.04 on Optimus Laptop] Setting up Ubuntu 14.04 with nvidia drivers and CUDA on Dell 7559 Optimus laptop #Ubuntu #Nvidia #CUDA #setup
### NOTE ###
The below gist is converted to a blog post and available at below link. Refer that instead.
http://hemenkapadia.github.io/blog/2016/11/11/Ubuntu-with-Nvidia-CUDA-Bumblebee.html
#### Note about kernel versions ####
Between kernel versions 4.2 and 4.4 there are different options that need to bet set
to get this working. The same is highlighted below when necessary. I have not tested
@ambar
ambar / gist:1534274
Created December 29, 2011 14:15 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@shunchu
shunchu / convert-seconds-into-hh-mm-ss-in-ruby.rb
Created July 25, 2012 07:58
Convert seconds into HH:MM:SS in Ruby
t = 236 # seconds
Time.at(t).utc.strftime("%H:%M:%S")
=> "00:03:56"
# Reference
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time
@erikhenrique
erikhenrique / bin-cc.md
Last active February 5, 2024 16:06
Bin de cartões de crédito para validação

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc
Visa 4 13,16 3
Mastercard 5 16 3
@jmnwong
jmnwong / ST2 Cycle Tabbing
Created June 28, 2013 15:24
Makes CTRL-Tab cycle tabs in order for Sublime Text.
Put in (Preferences -> Key Bindings - User):
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }