Skip to content

Instantly share code, notes, and snippets.

View dipnlik's full-sized avatar

Alexandre Lima dipnlik

View GitHub Profile
@dipnlik
dipnlik / custom.css
Last active November 2, 2020 22:45
Agrupa os horários da grade de eventos da #pybr2020, eu uso com a extensão Stylus da Chrome Web Store
.fc-segunda-view .fc-list-item:nth-child(n+4):not(.keynote-entry) { background-color: lightyellow; }
.fc-segunda-view .fc-list-item:nth-child(n+8):not(.keynote-entry) { background-color: lightblue; }
.fc-segunda-view .fc-list-item:nth-child(n+12):not(.keynote-entry) { background-color: lightyellow; }
.fc-segunda-view .fc-list-item:nth-child(n+16):not(.keynote-entry) { background-color: lightblue; }
.fc-segunda-view .fc-list-item:nth-child(n+20):not(.keynote-entry) { background-color: lightyellow; }
.fc-segunda-view .fc-list-item:nth-child(n+24):not(.keynote-entry) { background-color: lightblue; }
.fc-terca-view .fc-list-item:nth-child(n+3):not(.keynote-entry) { background-color: lightyellow; }
.fc-terca-view .fc-list-item:nth-child(n+7):not(.keynote-entry) { background-color: lightblue; }
.fc-terca-view .fc-list-item:nth-child(n+11):not(.keynote-entry) { background-color: lightyellow; }
@dipnlik
dipnlik / ratio_organizer.sh
Created December 10, 2012 20:50 — forked from metalrufflez/wallpaper_organizer.sh
Organize wallpapers according to aspect ratio
#!/bin/bash
shopt -s nullglob # won't error if a glob has no match
wallpaper_dir="$HOME/Dropbox/Photos/Wallpapers"
cd $wallpaper_dir
files=(*jpg *jpeg *png *bmp)
for file in "${files[@]}"
do read -r width height <<< $(sips -g pixelWidth -g pixelHeight "$file" | awk '/pixel(Width|Height)/ {print $2}')
@dipnlik
dipnlik / SpecHelper.js
Created May 29, 2012 14:04
adds flunk() to jasmine so specs can be marked as incomplete. Not using pending() because the spec is marked as failed
beforeEach(function() {
this.addMatchers({
flunk: function(description) {
this.message = function() { return "Flunk: " + description + "."; }
return false;
}
});
});
function flunk(description) {
@dipnlik
dipnlik / windows.scpt
Created January 1, 2012 21:26
Reboot to Windows, but just once
do shell script "bless -mount /Volumes/BOOTCAMP/ -legacy -setBoot -nextonly" with administrator privileges
tell application "System Events" to restart
@dipnlik
dipnlik / metalrufflezawards.rb
Created December 1, 2011 18:50
Fazendo jus ao prêmio Tudo é motivo pra aprender/oportunidade pra programar
Prêmio Migrante: @knorrium
Prêmio Hipster: @rafalemos
Prêmio Sumido: @diegomclima
Prêmio Tod Dog: @dipnlik
Prêmio #Apapu: @macari
Prêmio Luis Fernando Veríssimo: @soulomaeda
Prêmio Avatar Eterno: @emarx
Prêmio Fiscal do Metrô: @r0cc0
Prêmio Psico: Avatar do @srninja
Prêmio #corrainibeijadoritos: @caiocorraini
@dipnlik
dipnlik / post-receive
Created October 3, 2011 20:09
Post-receive hook to deploy projects by simply pushing to the repository
#!/bin/bash
# Don't forget to check environments and deploy paths before using this script.
function deploy {
echo "INFO: Deploying to $environment environment."
mkdir -p $DEPLOY_PATH
GIT_WORK_TREE=$DEPLOY_PATH git checkout -f $environment
}
@dipnlik
dipnlik / composite_primary_keys-2.3.5.1.gemspec
Created August 16, 2011 20:26
Download and patch composite_primary_keys 2.3.5.1 to require activerecord ~> 2.3.5 instead of >= 2.3.5. Installs as version 2.3.5.2
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{composite_primary_keys}
s.version = "2.3.5.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Dr Nic Williams"]
s.date = %q{2010-02-12}
s.description = %q{Composite key support for ActiveRecords}
@dipnlik
dipnlik / gist:1072252
Created July 8, 2011 16:51
User CSS pro tema Preview (Dense) do gmail não usar TANTO espaço em branco assim
/* reduz altura das linhas da tabela de emails */
tr.zA > td { padding-top:2px!important; padding-bottom:2px!important; }
/* não preciso mais de link de preview */
span#\:qz { display:none!important; }
/* lista de emails mais próxima dos botões acima dela
div.qRauBc { margin-top:0!important; }
*/
@dipnlik
dipnlik / .profile
Created May 4, 2010 15:20
rvm </3 PATH with spaces
export PATH="$HOME/Development/bin:\
/opt/local/bin:/opt/local/sbin:\
/usr/local/jruby/bin:\
/usr/local/mongodb/bin:\
/usr/local/mysql/bin:\
$PATH"
# rvm
if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi
@dipnlik
dipnlik / prexeca_bangers.rb
Created April 16, 2010 01:30
LordEternal para colírio da Capricho :)
#!/usr/local/jruby/bin/jruby
require "rubygems"
require "celerity"
@browser = Celerity::Browser.new(:browser => :firefox)
lord_eternal_id = "33125302527857541563"
@browser.goto "http://colirios.capricho.abril.com.br/batalha.php?idColirio=#{lord_eternal_id}"
puts "@browser ready."