Skip to content

Instantly share code, notes, and snippets.

@luiscoms
luiscoms / pages.php
Created September 8, 2014 14:54
Codeigniter Controller
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Pages extends CI_Controller {
public function __construct() {
parent::__construct();
session_name('lpi_luiscoms'); //load session name
session_start();
}
@luiscoms
luiscoms / oracle_cursor.sql
Last active August 29, 2015 14:03
Oracle Anonimous Block using cursor
/**
* Allow server to debug information
*/
SET SERVEROUTPUT ON;
DECLARE
crCursor SYS_REFCURSOR;
res VARCHAR2(200);
BEGIN
@luiscoms
luiscoms / copypublickey.sh
Last active August 29, 2015 14:02
Generate and copy ssh publickey to remote host
#!/bin/bash
# replace config
REMOTEUSER="luiscoms"
REMOTEHOST="example.com"
# generate ssh key if not exits
if [ ! -f ~/.ssh/id_dsa.pub ];then
ssh-keygen -t dsa
fi
@luiscoms
luiscoms / merge-cvs.sh
Created May 28, 2014 20:14
Script to merge an CVS project
#!/bin/sh
usage() {
mesy "Usage: "`basename $0`" -p <project> -b <branch> -t <tag>
"
}
# green
mesg() {
[ -t 1 ] && echo "\033[1;32m#####" $* "#####\033[0m" || echo -n "#####" $* "#####"
@luiscoms
luiscoms / .gitconfig
Last active January 30, 2023 00:59
My gitconfig
[user]
name = Luis Fernando Gomes
email = [email protected]
[core]
ignorecase = false
[push]
default = current
@luiscoms
luiscoms / .bash_profile
Last active July 19, 2022 16:52
My bash scripts
. "$HOME/.improvedbash/pretty-log.sh"
. "$HOME/.improvedbash/selfupdate.sh" -d
. "$HOME/.improvedbash/colors.sh"
. "$HOME/.improvedbash/ps1.sh"
# colorize bash commands
if uname -a | grep -qi linux; then
eval `dircolors -b`
alias ls='ls --color=auto'