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
  • 21:40 (UTC -03:00)
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / .pylintrc
Created January 26, 2015 19:04
Pylint rc file template for django projects. Ignores migrations and test suites.
[MASTER]
profile=no
persistent=yes
ignore=tests.py, urls.py, migrations
cache-size=500
[MESSAGES CONTROL]
# C0111 Missing docstring
# I0011 Warning locally suppressed using disable-msg
# I0012 Warning locally suppressed using disable-msg
@joepreludian
joepreludian / email.py
Created September 16, 2014 16:43
Uma forcinha =P
import string
l, m, email = string.ascii_lowercase, [], ''
k = [4, 12, 0, 8, 11, 7, 4, 13, 17, 8, 16, 20, 4]
for key in k:
email += l[key]
print '%[email protected]' % email
@joepreludian
joepreludian / desafio2.md
Created August 29, 2014 18:30
Desafio para desenvolvimento #2

Desafio dev: Talentos v.1

O foco desse desafio é implementar um cadastro de talentos. Através dele iremos cadastrar alguns poucos dados de um candidato à uma vaga de trabalho.

##Funcionaria assim: O usuário entrará em uma pagina pedindo os seguintes dados:

  • Nome
  • Email