Skip to content

Instantly share code, notes, and snippets.

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

Andrés Aquino andresaquino

🏠
Working from home
View GitHub Profile
@andresaquino
andresaquino / gist:708323
Created November 21, 2010 01:08
Update two or more repositories...
#I update github and gitorious (mi principal trunk is in gitorious)
# w/GitHub
git remote add github git@github.com:username/project.git
# w/Gitorious
git remote add gitorious git@gitorious.org:username/project.git
# and updating
@01-Scripts
01-Scripts / abort_merge.txt
Last active September 24, 2015 15:57
Working with git and github, ssh, console & co.
Abort a (conflicted) merge:
git merge --abort
@webdevwilson
webdevwilson / monitor-directory.groovy
Created January 19, 2011 15:56
Groovy code to monitor a directory and copy modified files to a different directory
String.metaClass.div = { f -> delegate + File.separator + f }
def extensions = ['.jpg','.css','.js','.jsp']
def source = new File( args.length > 0 ? args[0] : '.' ).absolutePath
def dest = new File( args.length > 1 ? args[1] : discoverJBoss() ).absolutePath
println "Monitoring ${source}"
println "Any modified files will be copied to ${dest}"
def files = buildFileList(source, extensions)
@fcastellanos
fcastellanos / more_test_events.rb
Created August 12, 2011 00:47
DSL Example in Ruby
def monthly_sales
110 # TODO: read the real number from the database
end
setup do
puts "Setting up target sales"
@target_sales = 100
end
event "monthly sales are suspiciously high" do
@morimori
morimori / 1.9.3-p0.log
Created November 1, 2011 07:29
ruby Digest::* benchmark
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
Rehearsal ------------------------------------------
MD5 1.010000 0.000000 1.010000 ( 1.026340)
SHA1 1.710000 0.000000 1.710000 ( 1.724464)
SHA2 3.780000 0.000000 3.780000 ( 3.824757)
SHA256 3.460000 0.010000 3.470000 ( 3.498111)
--------------------------------- total: 9.970000sec
user system total real
MD5 1.020000 0.000000 1.020000 ( 1.025751)
@i-stos
i-stos / MySQL-Guide.txt
Created April 23, 2012 14:26
MySQL: Basic MySQL Guide
==========================================================================================================
MySQL Guide - Basics
==========================================================================================================
Connect/Disconnect from MySQL Server
----------------------------------------------------------------------------------------------------------
:~ sudo mysqld_safe //Turns on MySQL server
:~ mysql -h host -u root -p //Connects to MySQL server: "no need to specify host on local"
mysql> quit; //Disconnects from MySQL
:~ mysqladmin -u root -p shutdown //Shuts down MySQL server
----------------------------------------------------------------------------------------------------------
@richieforeman
richieforeman / makeauthority.sh
Created July 23, 2012 21:38
Issue Your Own Self-Signed S/MIME Certs with OpenSSL
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@grimrose
grimrose / logback.groovy
Created September 21, 2012 01:22
groovy script with logback
//
// Built on Fri Sep 21 02:55:59 CEST 2012 by logback-translator
// For more information on configuration files in Groovy
// please see http://logback.qos.ch/manual/groovy.html
// For assistance related to this tool or configuration files
// in general, please contact the logback user mailing list at
// http://qos.ch/mailman/listinfo/logback-user
// For professional support please see
@Grab('org.quartz-scheduler:quartz:2.1.6')
@Grab('org.slf4j:slf4j-simple:1.7.1')
import org.quartz.*
import org.quartz.impl.*
import org.quartz.jobs.*
import static org.quartz.DateBuilder.*
import static org.quartz.JobBuilder.*
import static org.quartz.TriggerBuilder.*
import static org.quartz.CalendarIntervalScheduleBuilder.*
@SammysHP
SammysHP / gist:5611986
Created May 20, 2013 12:41
Vim logo in ascii art
.
##############..... ##############
##############......##############
##########..........##########
##########........##########
##########.......##########
##########.....##########..
##########....##########.....
..##########..##########.........
....##########.#########.............