Skip to content

Instantly share code, notes, and snippets.

View geoom's full-sized avatar
🏠
Working from home

George Mejia geoom

🏠
Working from home
View GitHub Profile
@geoom
geoom / django instructions
Created June 7, 2013 13:26
basic commands for using django (tested in debian)
/* -----------------------------------------
Using django framework
----------------------------------------- */
pip install django // install django
pip instal django=1.4.3 // install django with specified version
django-admin.py startproject <project-name> // create a new project named 'myproject'
django-admin.py startapp <app-name> // create a new app named 'myproject' inside project
@geoom
geoom / shellwrapper.sh
Created June 7, 2013 13:19
For those scripts needing a single do-it-all tool, a Swiss army knife, there is Perl. Perl combines the capabilities of sed and awk, and throws in a large subset of C, to boot. It is modular and contains support for everything ranging from object-oriented programming up to and including the kitchen sink. Short Perl scripts lend themselves to emb…
#!/bin/bash
# Adds up a specified column (of numbers) in the target file.
# Floating-point (decimal) numbers okay, because awk can handle them.
ARGS=2
E_WRONGARGS=85
if [ $# -ne "$ARGS" ] # Check for proper number of command-line args.
then
@geoom
geoom / fichero_A.sorted.txt
Created June 7, 2013 13:16
CRUCES DE FICHEROS (JOIN MATCH + UNMATCH): Se generan tres ficheros de salida: “000_A_and_B.txt”: Registros que han cruzado “000_A_and_notB.txt”: Registros del fichero primario que no se encuentran en el secundario “000_notA_and_B.txt”: Registros del fichero secundario que no se encuentran en el primario
Apr 21 70 74 514
Apr 31 52 63 420
Aug 15 34 47 316
Feb 15 32 24 226
Feb 26 58 80 652
Jan 13 25 15 115
Jan 21 36 64 620
Jul 24 34 67 436
Jun 31 42 75 492
Mar 15 24 34 228
@geoom
geoom / Motion sensor.ino
Last active December 14, 2015 04:29
basic code that generate a log for console on a terminal when happen or detected a motion
// this constant won't change:
const int buttonPin = 2; // the pin that the pushbutton is attached to
const int ledPin = 13; // the pin that the LED is attached to
// Variables will change:
int buttonPushCounter = 0; // counter for the number of button presses
int buttonState = 0; // current state of the button
int lastButtonState = 0; // previous state of the button
void setup() {