Skip to content

Instantly share code, notes, and snippets.

View jaimeguzman's full-sized avatar

Jaime Guzman jaimeguzman

View GitHub Profile
@jaimeguzman
jaimeguzman / gist:c5755298a7ea7f86dec0
Last active September 8, 2015 00:11 — forked from schmurfy/gist:3199254
Install pandoc Mac OS X 10.8
# Install MacTex: http://mirror.ctan.org/systems/mac/mactex/mactex-basic.pkg
$ sudo chown -R `whoami` /usr/local/texlive
$ tlmgr update --self
$ tlmgr install ucs
$ tlmgr install etoolbox
# Install pandoc view homebrew
@jaimeguzman
jaimeguzman / .gitignore
Created October 26, 2015 20:17 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@jaimeguzman
jaimeguzman / gistWPChangeDatabaseStaticUR.sql
Last active October 27, 2015 16:58
WP Change Database static url
-- Un script sensato
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@jaimeguzman
jaimeguzman / gist:25c550cde3ac04347fe7
Created November 30, 2015 04:15 — forked from wspringer/gist:1649700
LZW Encoding *and Decoding* in Scala
object lzw {
trait Appendable[T] {
def append(value: T)
}
import scala.collection.generic._
case class GrowingAppendable[T](growable: Growable[T]) extends Appendable[T] {
def append(value: T) {
growable += value
@jaimeguzman
jaimeguzman / LZ78.java
Created December 1, 2015 00:07
Slow implementation of famous compression algorithm (LZ78)
//http://stackoverflow.com/questions/1130534/slow-implementation-of-famous-compression-algorithm-lz78
import java.io.File;
import java.io.FileInputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@jaimeguzman
jaimeguzman / git-overwrite-pull-reminder.md
Created December 12, 2015 18:37
Commands to Overwrite Local Files

#Commands to Overwrite Local Files:-

Use the following command to force overwrite local files from remote repository. We are assuming you are downloading changes from remote master branch.

$ git fetch --all
$ git reset --hard origin/master

>>To download changes from some other branch use the following command.

@jaimeguzman
jaimeguzman / show-git-branch-in-bash-prompt
Created February 2, 2016 03:05 — forked from stuarteberg/show-git-branch-in-bash-prompt
Code for your .bashrc file. Show current git branch on bash shell prompt....with color! (This was copied and modified from similar code you can find out there on the 'tubes.)
# Colors for the prompt
blue="\033[0;34m"
white="\033[0;37m"
green="\033[0;32m"
# Brackets needed around non-printable characters in PS1
ps1_blue='\['"$blue"'\]'
ps1_green='\['"$green"'\]'
ps1_white='\['"$white"'\]'
@jaimeguzman
jaimeguzman / colo-git-branch.sh
Last active March 15, 2016 23:45
show git branch on terminal with different colors
# Colors for the prompt
blue="\033[0;34m"
white="\033[0;37m"
green="\033[0;32m"
# Brackets needed around non-printable characters in PS1
ps1_blue='\['"$blue"'\]'
ps1_green='\['"$green"'\]'
ps1_white='\['"$white"'\]'
@jaimeguzman
jaimeguzman / gist:3ea5436eed73765c1033
Last active April 11, 2016 12:33
sbt3 user reference config
{
"color_inactive_tabs": true,
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme",
"draw_indent_guides": false,
"font_size": 13,
"ignored_packages":
[
"Vintage"
],
"tabs_padding_small": true,
@jaimeguzman
jaimeguzman / bash-sea.md
Created April 21, 2016 17:43
Bash Escape Sequences

#Bash Escape Sequences


    \a     an ASCII bell character (07)
    \d     the date in "Weekday Month Date" format (e.g., "Tue May 26")
    \D{format}
           the format is passed to strftime(3) and the result is inserted into the prompt string; an empty format results in a locale-
           specific time representation.  The braces are required
 \e an ASCII escape character (033)