Skip to content

Instantly share code, notes, and snippets.

View dreamingechoes's full-sized avatar
Trying to do my best

Iván González Sáiz dreamingechoes

Trying to do my best
View GitHub Profile
@dreamingechoes
dreamingechoes / keybase.md
Created October 7, 2017 12:35
Keybase proof

Keybase proof

I hereby claim:

  • I am dreamingechoes on github.
  • I am dreamingechoes (https://keybase.io/dreamingechoes) on keybase.
  • I have a public key ASCLgnra8XylOOZQ22lqMktFrRiTN7UfHzIYeT4reODbWAo

To claim this, I am signing this object:

@dreamingechoes
dreamingechoes / flatabulous-terminal.sh
Created November 30, 2016 15:07
Script that adds a profile similar to the one on Flatabulous in Gnome-Terminal.
#!/usr/bin/env bash
# Base16 - Gnome Terminal color scheme install script
[[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="flatabulous-terminal"
[[ -z "$PROFILE_SLUG" ]] && PROFILE_SLUG="flatabulous-terminal"
[[ -z "$DCONF" ]] && DCONF=dconf
[[ -z "$UUIDGEN" ]] && UUIDGEN=uuidgen
dset() {
local key="$1"; shift
@dreamingechoes
dreamingechoes / all_mysql_dumps.sh
Last active October 13, 2016 11:35
Script to generate dumps of all our local databases on MySQL.
#!/bin/bash
# Suffix added at the end of the filename
NOW=$(date +"%d%m%Y")
# Destination folder of all the dumps
DEST="backups"
# Set mysql login info
MUSER="root"
* * * * * command to execute
│ │ │ │ │
│ │ │ │ └─── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0)
│ │ │ └──────── month (1 - 12)
│ │ └───────────── day of month (1 - 31)
│ └────────────────── hour (0 - 23)
└─────────────────────── min (0 - 59)
@dreamingechoes
dreamingechoes / update_git_repos.sh
Last active May 23, 2016 16:41 — forked from douglas/update_git_repos.sh
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@dreamingechoes
dreamingechoes / scraping-pokemondb.rb
Last active March 7, 2016 08:30
A simple test of web scraping to fetch Pokemons data from pokemondb.net
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
base_url = "http://pokemondb.net"
url_index = "#{base_url}/pokedex/game/firered-leafgreen"
index = Nokogiri::HTML(open(url_index))
@dreamingechoes
dreamingechoes / hashit.rb
Last active December 15, 2015 10:16
Convert ruby hashes into objects.
class Hashit
def initialize(hash)
hash.each do |k,v|
self.instance_variable_set("@#{k}", v.is_a?(Hash) ? Hashit.new(v) : v)
self.class.send(:define_method, k, proc{self.instance_variable_get("@#{k}")})
self.class.send(:define_method, "#{k}=", proc{|v| self.instance_variable_set("@#{k}", v)})
end
end
end
@dreamingechoes
dreamingechoes / git-cheat-sheet.sh
Created December 7, 2015 21:17
Git cheat sheet.
git init
# initializes an empty git in the current directory
git config -l
git config --global user.name "<your name>"
git config --global user.email "<your email>"
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
@dreamingechoes
dreamingechoes / therubyracer-0.10.2-installation-script.sh
Created September 18, 2015 07:54
Script to solve installation of therubyracer gem version 0.10.2 on Mac OS X
brew tap homebrew/dupes
brew install apple-gcc42
export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2
brew uninstall v8
gem uninstall libv8
@dreamingechoes
dreamingechoes / .jshinrc.js
Created September 14, 2015 11:21
Basic .jshinrc file
// NOTE: Added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension.
{
"browser" : true,
"jquery" : true,
"devel" : true,
"curly" : true,
"latedef" : true,
"maxdepth" : 3,
"newcap" : true,
"noarg" : true,