Skip to content

Instantly share code, notes, and snippets.

View samirfor's full-sized avatar

Samir C. Costa samirfor

  • Brazil
  • 12:56 (UTC -03:00)
View GitHub Profile
<?php
/*
Uninuni.com on 30 july 2008
Fixed:
MySql sintax when setting columns to latin1
Now we have 6 types of binary instead of just blob (avoid 'key length' error)
No more need to set the DB name on the source code
*/
/*
%{
#define ARQUIVO "tabela_de_simbolos.txt"
#define TAMANHO_ID 200
#define ID 100
#define NUM 101
#define IF 102
#define ELSE 103
#define WHILE 104
#define PAR_A 105
#define PAR_F 106
/**
Copyright (C) 2014 Samir C. Costa <samirfor@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@samirfor
samirfor / php.inc
Last active August 29, 2015 14:08
Config. PHP Nginx
# Simple include for PHP files
# Put this file in /etc/nginx/conf.d/
index index.php index.html;
location = /favicon.ico {
log_not_found off;
access_log off;
}
@samirfor
samirfor / gerenciador.hex
Created February 5, 2015 03:32
Grave o gerenciador.hex em anexo no microcontrolar PIC com interface USB para utilizar a ferramenta SanUSB http://br.groups.yahoo.com/group/GrupoSanUSB. A placa SanUSB pode ser construída seguindo os tutoriais pdf em anexo ou adquirida em http://lista.mercadolivre.com.br/sanusb
:020000040000FA
:06000000DEEF07F0120024
:0600080004EF08F01200F5
:060018000CEF08F01200DD
:0E0020000100E80F0000FE00000002000000DA
:02002E003F0E83
:1000300093160001636B676968696969666B010EF5
:100040006A6F1200D9CFE6FFE1CFD9FFE652000177
:1000500063511FE1040108BF1BD0400EE66E600E25
:10006000E66E030EE66E0AEC06F0E552E552E55246
@samirfor
samirfor / semaforo_com_tempo_para_pedestre.c
Last active August 29, 2015 14:14
Semáforo com tempo para pedestre em PIC18F2550 + SanUSB.
/**
* Ferramenta SanUSB: http://sanusb.site50.net/
* Compilar com MPLABX+C18: https://drive.google.com/open?id=0B5332OAhnMe2N3czQWxVX0JVSkE&authuser=0
*
* Este programa reproduz um semáforo de LEDs.
*
* Foto da montagem: https://drive.google.com/file/d/0BwIZj8djOAj2VTVWUWhOX0ZyeG8/view?usp=sharing
*/
#include "SanUSB48.h"
@samirfor
samirfor / Pisca2.c
Created February 6, 2015 23:54
Pisca LED
/**
* Ferramenta SanUSB: http://sanusb.site50.net/
* Compilar com MPLABX+C18: https://drive.google.com/open?id=0B5332OAhnMe2N3czQWxVX0JVSkE&authuser=0
*
* Este programa pisca o LED do pino b7.
* Foto da placa: https://drive.google.com/file/d/0BwIZj8djOAj2akptcEEwcFpOazg/view?usp=sharing
*/
#include "SanUSB48.h"
/**
* Ferramenta SanUSB: http://sanusb.site50.net/
* Compilar com MPLABX+C18: https://drive.google.com/open?id=0B5332OAhnMe2N3czQWxVX0JVSkE&authuser=0
*
* Este programa semáforo com LEDs com sinalização de tempo para pedestres (cronometro regressivo).
*
* Foto da placa: https://drive.google.com/file/d/0BwIZj8djOAj2dnJGZ3FKUFM2NFE/view?usp=sharing
* Esquema: https://drive.google.com/file/d/0BwIZj8djOAj2U2RjSHdXdDBfTXM/view?usp=sharing
* Vídeo: https://www.youtube.com/watch?v=6erQAws2SIU
*/
@samirfor
samirfor / semaforo_com_tempo_para_pedestre_display7seg_mux.c
Last active August 29, 2015 14:16
Este programa reproduz um semáforo de LEDs com sinalização de tempo para pedestres com 2 displays de 7 segmentos multiplexados (cronometro regressivo).
/**
* Ferramenta SanUSB: http://sanusb.site50.net/
* Compilar com MPLABX+C18: https://drive.google.com/open?id=0B5332OAhnMe2N3czQWxVX0JVSkE&authuser=0
*
* Este programa reproduz um semáforo de LEDs com sinalização de tempo para
* pedestres com 2 displays de 7 segmentos multiplexados (cronometro regressivo).
*
* Foto da placa: https://drive.google.com/file/d/0BwIZj8djOAj2cTFsdTNTMDNCd0k/view?usp=sharing
* Esquema no fritzing: https://drive.google.com/file/d/0BwIZj8djOAj2RTVxTGNoY00wQ1E/view?usp=sharing
* https://drive.google.com/file/d/0BwIZj8djOAj2M3pYcUMySTFYRG8/view?usp=sharing
@samirfor
samirfor / mkvsrtadd.sh
Last active August 29, 2015 14:18
This script adds a subtitle file srt in a mkv file. In addition, it converts the encoding of the srt file to UTF-8, for some TVs (such as the Sony Bravia KDL-40W605) use this as the default encoding.
#!/bin/bash
################################################################
# This script adds a subtitle file srt in a mkv file. #
# In addition, it converts the encoding of the srt file #
# to UTF-8, for some TVs (such as the Sony Bravia KDL-40W605) #
# use this as the default encoding. #
# #
# TIP: Combine with script "mkvsrtaddbatch" (available in #
# https://gist.github.com/samirfor/3e9fe8aa2a2feb89f8e7to) to #
# process a batch of files at once. #