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 / 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() {
@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 / 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 / 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 / nodejs instrucctions
Last active December 18, 2015 04:59
basic commands for using nodejs (tested in debian)
/* -----------------------------------------
Install node.js and npm in Debian
----------------------------------------- */
*firts way (recommended):
sudo apt-get install python-software-properties python g++ make
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
@geoom
geoom / sass and compass instructions
Created June 7, 2013 13:29
basic commands for using sass and compass (tested in debian)
/* -----------------------------------------
Install Ruby and RubyGems in Debian
----------------------------------------- */
$ sudo apt-get install ruby1.9.1
$ sudo apt-get install rubygems
/* -----------------------------------------
Using Saas
----------------------------------------- */
@geoom
geoom / less instructions
Last active December 18, 2015 04:59
basic commands for using less (tested in debian)
/* -----------------------------------------
Install node.js and npm in Debian
----------------------------------------- */
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
@geoom
geoom / gist:5746809
Created June 10, 2013 06:03
Hotel management -
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<stdio.h>
#include<dos.h>
class hotel
{
int room_no;
char name[30];
Run this in your command line to make the process begin:
$ curl -o ko3_structure.sh https://raw.github.com/gist/1702555/ko3_structure.sh && ./ko3_structure.sh
@geoom
geoom / gist:5849204
Created June 24, 2013 10:39
CSS Media Queries for All Devices
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* STYLES GO HERE */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {