Skip to content

Instantly share code, notes, and snippets.

View edgardleal's full-sized avatar
💻
working from home

Edgard Rosberg Duarte Leal edgardleal

💻
working from home
View GitHub Profile
@edgardleal
edgardleal / robot.js
Created December 5, 2012 16:53
Edgard
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@edgardleal
edgardleal / NumbersNames
Created February 10, 2014 18:01
Arrays with descriptions of days of month , days of week and hours of day
public class NumbersNames{
private static final String[] tensNames = { "", " ten", " twenty",
" thirty", " forty", " fifty", " sixty", " seventy", " eighty",
" ninety" };
private static final String[] numNames = { "zero", " one", " two",
" three", " four", " five", " six", " seven", " eight", " nine",
" ten", " eleven", " twelve", " thirteen", " fourteen", " fifteen",
" sixteen", " seventeen", " eighteen", " nineteen" };
private static String[] daysOfWeek = { "", "Sunday", "Monday", "Tuesday",
@edgardleal
edgardleal / gist:9499639
Created March 12, 2014 02:30
Execute sql command in firebird database on shell script
isql -user SYSDBA -password masterkey /var/firebird/database.fdb -i "/home/tux/sql/command.sql" -o "/home/tux/log/log.txt"
@edgardleal
edgardleal / is_installed.sh
Last active August 29, 2015 13:57 — forked from JamieMason/is_installed.sh
Verify nodejs tools is instaled
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
@edgardleal
edgardleal / gist:158e682631b2edd42d8f
Last active July 9, 2016 14:52 — forked from jessedearing/gist:2351836
Generate self signed ssl certificate
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
#!/bin/sh
##
## Redhat / Linux / LSB
##
# chkconfig: 345 80 20
# description: Startup script for Express / Node.js application with the \
## forever module.
##
## A modification of https://gist.github.com/1339289
##
@edgardleal
edgardleal / make_postgresql_bacula_tables
Created August 31, 2014 17:44
Script to create bacula tables on postgresql
CREATE TABLE Filename
(
FilenameId serial not null,
Name text not null,
primary key (FilenameId)
);
ALTER TABLE Filename ALTER COLUMN Name SET STATISTICS 1000;
CREATE UNIQUE INDEX filename_name_idx on Filename (Name);
@edgardleal
edgardleal / install.sh
Last active August 29, 2015 14:06 — forked from julesbou/install.sh
###
### Debian configuration
###
# --- Bashrc ---
echo "