Skip to content

Instantly share code, notes, and snippets.

View shingonoide's full-sized avatar

Rui Andrada shingonoide

View GitHub Profile
@shingonoide
shingonoide / Compiling gem mysql on MacOSX fail!
Created November 1, 2010 20:23
Trying to compile gem mysql on MacOSX, what can be wrong?
$ ls -al /usr/local/
total 8
drwxr-xr-x 6 root wheel 204 29 Out 15:12 .
drwxr-xr-x@ 14 root wheel 476 1 Nov 13:45 ..
drwxr-xr-x 3 root wheel 102 29 Out 15:12 bin
drwxr-xr-x 8 root wheel 272 29 Out 12:59 git
lrwxr-xr-x 1 root wheel 24 29 Out 13:02 mysql -> mysql-5.1.51-osx10.6-x86
drwxr-xr-x 17 root wheel 578 13 Set 13:44 mysql-5.1.51-osx10.6-x86
$ env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/local/mysql/ --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include
# encoding: UTF-8
namespace :brazil do
desc "Load brazilian states for spree store"
task :states => :environment do
brazil = Country.find :first, :conditions => {:name => "Brazil"}
states = <<STATES
AC,Acre
AL,Alagoas
AP,Amapá
AM,Amazonas
@shingonoide
shingonoide / gist:948266
Created April 29, 2011 13:10
Wrong awnser form "Network Utility"
Server Name: HI.IM.PAULOR.NET
IP Address: 77.232.76.14
Registrar: ENOM, INC.
Whois Server: whois.enom.com
Referral URL: http://www.enom.com
>>> Last update of whois database: Fri, 29 Apr 2011 12:37:52 UTC <<<
@shingonoide
shingonoide / gist:968791
Created May 12, 2011 15:45
Irb session testing generic regex
ruby-1.8.7-p334 :001 > /<p>.*</p>/
ruby-1.8.7-p334 :002/> /<p>.*<\/p>/
SyntaxError: compile error
(irb):1: unknown regexp option - p
(irb):2: syntax error, unexpected '.'
/<p>.*<\/p>/
^
from (irb):2
ruby-1.8.7-p334 :003 > /<p>.*<\/p>/
=> /<p>.*<\/p>/
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>Irritando Fernanda Young - Facebook Application </title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="pt-br" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
<!-- <link rel="stylesheet" href="css/fcbk_style.css" type="text/css" media="screen" title="Test Stylesheet" charset="utf-8" /> -->
@shingonoide
shingonoide / gist:8172291
Created December 29, 2013 16:58
Trying to install PIL "pip install PIL" and got this error.
building '_imagingft' extension
gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protecto
r --param=ssp-buffer-size=4 -fPIC -I/usr/include/freetype2 -IlibImaging -I/home/cafeerp/instances/cafeerp_ocb7/include -I/usr/local/include -I/usr/include -I/usr/include/python2.7 -
c _imagingft.c -o build/temp.linux-x86_64-2.7/_imagingft.o
_imagingft.c:73:31: fatal error: freetype/fterrors.h: No such file or directory
#include <freetype/fterrors.h>
@shingonoide
shingonoide / README.md
Last active August 29, 2015 14:02 — forked from mbostock/.block

This grouped bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:

@shingonoide
shingonoide / module_core.py
Last active August 29, 2015 14:10
Odoo my_module simplification
# code snip for clarification
class module_core_user_input(osv.Model):
_name = "module_core.user_input"
_description = 'Module Core User Input'
_columns = {
'master_document_id': fields.many2one('qdi_core.survey', 'Master Document', required=True,
readonly=1, ondelete='restrict'),
'user_input_line_ids': fields.one2many('module_core.user_input_line',
'user_input_id', 'Inputs'),
@shingonoide
shingonoide / dabblet.css
Last active August 29, 2015 14:28 — forked from chriscoyier/dabblet.css
Checkbox Hack
/* Checkbox Hack */
input[type=checkbox] {
position: absolute;
top: -9999px;
left: -9999px;
}
label {
-webkit-appearance: push-button;
-moz-appearance: button;