Skip to content

Instantly share code, notes, and snippets.

View eduardojmatos's full-sized avatar

Eduardo Matos eduardojmatos

View GitHub Profile
@dcrec1
dcrec1 / seeds.rb
Created April 29, 2010 15:07
State of Brazil for Spree
states = <<STATES
28,AC,Acre
28,AL,Alagoas
28,AP,Amapá
28,AM,Amazonas
28,BA,Bahia
28,CE,Ceará
28,ES,Espírito Santo
28,GO,Goiás
28,MA,Maranhão
@sergiocampama
sergiocampama / install.sh
Created November 7, 2012 19:33
Postgresql 9.2.1 Installation instructions for Ubuntu 12.04
#Postgresql 9.2.1 Compilation instructions for Ubuntu 12.04
#This will install Postgresql 9.2.1 into /usr/local/postgresql-9.2.1
#This assumes that you have sudo provileges on the machine installing postgresql
#It should work by copying and pasting into the shell, I haven't tested it, I just summarized
#what I just did and it worked
#Get requirements
sudo apt-get install build-essential libreadline6-dev zlib1g-dev
@wbotelhos
wbotelhos / sass_parser_debug.md
Last active December 8, 2017 13:19
SASS Parser Debug

Open the gem:

gem open sass

Add the following code at lib/sass/scss/parser.rb:1277:

puts '-' * 50
@jaydson
jaydson / gist:c44c60a26edff19d45fe
Last active November 10, 2018 14:27
Hotéis Porto Alegre - BrazilJS
@justinperkins
justinperkins / jquery-auth-token.js
Created October 26, 2012 17:48
Put auth-token on all jQuery Ajax Requests
$(function(){
var tokenValue = $("meta[name='csrf-token']").attr('content');
$.ajaxSetup({
headers: {'X-CSRF-Token': tokenValue}
});
})
@adrianoxavier
adrianoxavier / frete.js
Last active April 5, 2021 19:24
Calculo de Frete, serviço dos correios
var request = require('request');
var xml2js = require('xml2js');
/*
código do serviço.
40010 SEDEX
41106 PAC
@mustafaturan
mustafaturan / ruby.2.6.3-setup.sh
Last active February 2, 2023 10:08
ruby 2.6.3 setup for centos 6.x
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active April 21, 2023 17:14
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {