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
  • 00:50 (UTC -03:00)
View GitHub Profile
USERS = {'admin@admin': '123',
'user': '123'}
GROUPS = {'admin': ['group:sysadmin'],
'user': ['group:users']}
def groupfinder(userid, request):
if userid in USERS:
return GROUPS.get(userid, [])
@joepreludian
joepreludian / negativo.py
Created November 15, 2013 15:05
Numero Negativo - Eliselma - Python
vetor = []
qtd_negativo = 0
for i in range(5):
print 'Insira o %s numero' % i
vetor.append(int(raw_input()))
for item in vetor:
if item < 0:
qtd_negativo += 1
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
<script src="skulpt.min.js" type="text/javascript"></script>
<script src="skulpt-stdlib.js" type="text/javascript"></script>
</head>
<body>
@joepreludian
joepreludian / mencoder-legenda
Created October 25, 2013 18:25
Embutindo legenda em um filme via linha de comando
#!/bin/sh
mencoder -sub $1.srt -ovc xvid -xvidencopts bitrate=-7000000 -oac copy -o $2.avi $1.avi -subwidth 90 -subpos 95 -subfont-text-scale 3
@joepreludian
joepreludian / checksite.sh
Created September 30, 2013 13:29
Que tal conferir se um site mudou de status? Fui realizar uma inscrição pra minha noiva e o site estava com uma mensagem de erro. Criei um shellscript que checava no site se ele tinha voltado a funcionar. Usei o cURL e o md5 pra fazer uma assinatura da mensagem. No exemplo ele preenche um formulário, enviando para o site do cadastro, identifican…
#!/bin/bash
say -r 190 "Up and running. Listening website for changes. I will keep You in touch. Bye.";
while [ 1 ]
do
get_status=$(curl -X POST "http://www.pm.pb.gov.br/concursos/inscricao__cfo/index.php" -d "dt_nascimento=01/01/1987" -d "nm_cpf=xxx.xxx.xxx-xx" -A "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.17 Safari/537.36" -d "modo=1" -d "cd_aluno=" -s | md5);
if [ $get_status = "e5948a465a078db264bb770ccea87510" ]
then
echo "Nothing new. Trying in 5 minutes...";
@joepreludian
joepreludian / texto_graphics.java
Created April 7, 2013 03:39
CodeSnippet - Java - Texto no objeto Graphics
//Pra colocar um texto
g.setColor(Color.GREEN);
//Determina a fonte e seu tamanho
Font font = new Font("Callibri", Font.PLAIN, 30);
g.setFont(font);
//Desenha o texto
g.drawString("Pedro maluco!", 25, 100);
@joepreludian
joepreludian / glsdosul.java
Created April 7, 2013 03:20
Arquivo Java com anotações do hangout
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package bandeira;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.GraphicsConfiguration;
import java.awt.Point;