Skip to content

Instantly share code, notes, and snippets.

View joepreludian's full-sized avatar
🛰️
Working from home

Jonhnatha Trigueiro joepreludian

🛰️
Working from home
  • Loka
  • Joao Pessoa PB
  • 14:16 (UTC -03:00)
View GitHub Profile
@joepreludian
joepreludian / hello.txt
Created January 29, 2015 15:06
Hello Word da Zueira
Parabéns, jovem! Significa que fez tudo direitinho! Tá uma mocinha!
-Joey
@joepreludian
joepreludian / git_submodules_commands.md
Created March 27, 2015 10:15
Clonando submódulos - Fast Lane

Alguns comandos úteis do GIT

No seu projeto GIT, para adicionar um, ou mais, submódulos, faça:

$ git submodule add https://github.com/chaconinc/DbConnector

Isto irá adicionar um submódulo. No root do projeto será criado um arquivo .gitmodules.

Clonando projeto com submódulos

Normalmente o repositório, quando é clonado, não vem com os submódulos carregados por padrão.

@joepreludian
joepreludian / count.asm
Created April 28, 2015 13:23
Contando de 9 a 0 em assembly
ORG 000H //initial starting address
START: MOV A,#00001001B // initial value of accumulator
MOV B,A
MOV R0,#0AH //Register R0 initialized as counter which counts from 10 to 0
LABEL: MOV A,B
INC A
MOV B,A
MOVC A,@A+PC // adds the byte in A to the program counters address
MOV P1,A
ACALL DELAY // calls the delay of the timer
@joepreludian
joepreludian / fabfile.py
Created May 25, 2015 10:13
Simplest Fabfile template for django projects
# -*- encoding: utf8 -*-
from fabric.api import env, settings, cd
from fabric.operations import run, sudo
env.hosts = ['trilhus@helena']
env.project_dir = '/home/trilhus/webapps/projectname'
env.branch = 'master'
def production():
@joepreludian
joepreludian / schema.sql
Created July 12, 2015 17:52
Granting schema to SQL
CREATE USER readonly WITH ENCRYPTED PASSWORD 'readonly';
GRANT USAGE ON SCHEMA public to readonly;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly;
-- repeat code below for each database:
GRANT CONNECT ON DATABASE foo to readonly;
\c foo
GRANT USAGE ON SCHEMA public to readonly;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO readonly;
@joepreludian
joepreludian / chars.py
Created July 15, 2015 19:24
Coletando chars sob demanda em Python
class _Getch:
"""Gets a single character from standard input. Does not echo to the
screen."""
def __init__(self):
try:
self.impl = _GetchWindows()
except ImportError:
self.impl = _GetchUnix()
def __call__(self): return self.impl()
@joepreludian
joepreludian / .tmux.conf
Created July 15, 2015 20:33
Init Files
bind -t vi-copy y copy-pipe "xclip -sel clip -i"
bind-key -n C-S-Up resize-pane -U 15
bind-key -n C-S-Down resize-pane -D 15
bind-key -n C-S-Left resize-pane -L 25
bind-key -n C-S-Right resize-pane -R 25
@joepreludian
joepreludian / site.nginx.conf
Created July 20, 2015 19:37
NGINX Template to handle php throught PHP-FPM over /var/run/sock/php.sock
server {
listen 80;
server_name myawesomesite.com www.myawesomesite.com;
client_max_body_size 4G;
root /home/mysite/public_html;
access_log /home/mysite/logs/nginx-access.log;
error_log /home/mysite/logs/nginx-error.log;
@joepreludian
joepreludian / .gitignore
Last active August 29, 2015 14:25 — forked from eykd/.gitignore
Full stack BDD testing with Behave+Mechanize+Django
*.pyc
bin/
include/
lib/
@joepreludian
joepreludian / gulpfile.js
Created August 11, 2015 02:36
GULP Stuff - Useful when working with coffeescript and sass
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
rename = require('gulp-rename');
var autoprefixer = require('gulp-autoprefixer');
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin'),
cache = require('gulp-cache');
var minifycss = require('gulp-minify-css');