Skip to content

Instantly share code, notes, and snippets.

View IsTheJack's full-sized avatar
🇧🇷
from Brazil. Based on 🇮🇪 Ireland

Roberto Oliveira IsTheJack

🇧🇷
from Brazil. Based on 🇮🇪 Ireland
View GitHub Profile
@IsTheJack
IsTheJack / git_log_as_JSON.sh
Created January 30, 2015 01:56
git log as JSON...
git log --pretty=format:'{%n "commit": "%H",%n "author": "%an <%ae>",%n "date": "%ad",%n "message": "%f"%n},' $@ | perl -pe 'BEGIN{print "["}; END{print "]\n"}' | perl -pe 's/},]/}]/' > commits-log.JSON
@IsTheJack
IsTheJack / log4JSON.sh
Created February 2, 2015 23:06
git log 4 Json
git log --pretty=format:\
"{\
%n \"commit\":\"%H\",\
%n \"data\":\"%ai\",\
%n \"nome\":\"%an\",\
%n \"email\":\"%ae\",\
%n \"commiter\":\"%cn\",\
%n \"mensagem\":\"%s\"\
%n}" > log4JSON.json
@IsTheJack
IsTheJack / 01_criando_tabelas.sql
Last active August 29, 2015 14:20
Laboratório de Banco de Dados 04/05/2015
create database lab_4_5_2015;
use lab_4_5_2015;
-- Criando tabela de Vendedores
create table vendedores (
vn char(3) primary key,
vnome char(20),
cidade char(15)
);
@IsTheJack
IsTheJack / Regexp
Created June 3, 2015 01:24
Regexp in C#
using System;
using System.Windows.Forms;
using System.Text.RegularExpressions;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
@IsTheJack
IsTheJack / Preferences.sublime-settings.json
Created September 16, 2015 19:13
My config on sublime text 3
{
"Seti_SB_med": true,
"Seti_in_4_a_treat": true,
"Seti_pad_3": true,
"Seti_pad_5": true,
"Seti_sb_small_padding": true,
"Seti_sb_tree_med": true,
"Seti_tabs_small": true,
"caret_extra_bottom": 0,
"caret_extra_top": 0,
@IsTheJack
IsTheJack / 14257042_roberto.c
Last active September 26, 2015 15:45
Prova de Estrutura de Dados
// ------------------------------------------
// -----------------14257042-----------------
// --------ROBERTO OLIVEIRA DA SILVA---------
// ------------ESTRUTURA DE DADOS------------
// -------------------AEDB-------------------
// ------------------------------------------
// OBS: Esse código foi feito e testado usando Windows 10 e DEV-C++ 5.11
#include <stdio.h>
@IsTheJack
IsTheJack / ProdutoTest.php
Created September 27, 2015 18:07
Exemplo de código de teste automatizado usando PHP Unit no Laravel
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ProdutoTest extends TestCase
{
/**
* Páginas atuais que precisam de autenticação para serem acessadas
@IsTheJack
IsTheJack / index.php
Last active October 9, 2015 20:38
Exemplo de front controller que cria um modelo de rotas baseando em um modelo de mvc simplificado.
<?php
/**
* Leve em consideração que vc têm o htaccess dessa forma:
* RewriteEngine on
* RewriteCond %{REQUEST_FILENAME} !-f
* RewriteCond %{REQUEST_FILENAME} !-d
* RewriteRule ^(.+)(\?.+)?$ index.php?params=$1 [L,QSA]
*/
/**
@IsTheJack
IsTheJack / login_aedb.html
Last active February 29, 2016 01:02
Logar direto no sistema acadêmico da AEDB sem precisar entrar no site e digitar o formulário chatão lá
<!DOCTYPE html>
<html lang="pt-br">
<body>
<form action="http://www.aspescola.com.br/app/appAuth" method="post" name="formularioAluno" role="form">
<input name="txt_CdInstituicao" type="hidden" value="277">
<input id="username" name="j_username" type="hidden">
<input id="password" name="j_password" type="hidden">
<input name="txt_DsRespostaSecreta" type="hidden" value="277">
<input name="txt_IdTipoUsuario" type="hidden" value="3">
<input id="txt_IdModulo" name="txt_IdModulo" type="hidden" value="2">
@IsTheJack
IsTheJack / Connection.cs
Created March 6, 2016 19:34
Singleton connection class with C# (ADO.NET)
using System.Data.SqlClient;
namespace Project.Infra
{
// Singleton Class
class Connection
{
// Connection's configuration:
private static string connectionString = @"YOUR-CONNECTION-STRING";
private static Connection singleton;