Skip to content

Instantly share code, notes, and snippets.

View vhuerta's full-sized avatar
🦖
Working from home

Victor Huerta vhuerta

🦖
Working from home
  • Mexico
View GitHub Profile
@vhuerta
vhuerta / .gitconfig
Created February 19, 2014 18:16
Usar Sublimetext para mezclar conflictos de git (mergetool)
[merge]
tool = sublimerge
[mergetool "sublimerge"]
cmd = subl -n --wait \"$REMOTE\" \"$BASE\" \"$LOCAL\" \"$MERGED\" --command \"sublimerge_diff_views\"
trustExitCode = false
[diff]
tool = sublimerge
@vhuerta
vhuerta / .zshrc
Last active July 17, 2017 13:06
My .zshrc
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="cobalt2"
# Uncomment the following line to use case-sensitive completion.
@vhuerta
vhuerta / usefull.sh
Created August 24, 2016 14:29
MySQL usefull commands
# Dump database into another
mysqldump -u user --password=pass live_db_name | mysql -u user --password=pass -h localhost duplicate_db_name
@vhuerta
vhuerta / install_mod_headers.sh
Created August 26, 2016 15:36
Compile apache mod_headers from source
sudo su -
wget http://www-eu.apache.org/dist//httpd/httpd-2.2.31.tar.gz
tar -xzvf httpd-2.2.31.tar.gz
cd httpd-2.2.31/modules/metadata/
/path/to/apache/bin/apxs -i -a -c mod_headers.c
nano /path/to/apache/httpd.conf
# AGREGAR ESTA LINEA AL FINAL DEL ARCHIVO
# Header always append X-Frame-Options DENY
/path/to/apache/apachectl configtest
/path/to/apache/apachectl restart
@vhuerta
vhuerta / . jsbeautifyrc
Created August 28, 2016 17:03
Custom beautify configuration for atom
{
"indent_size": 4,
"indent_char": " ",
"other": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 1,
"jslint_happy": true,
"html": {
@vhuerta
vhuerta / restart_bluetooth.sh
Created October 4, 2016 20:03 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@vhuerta
vhuerta / victroll.zsh-theme
Last active March 6, 2020 19:58
My personalized prompt
CURRENT_BG='NONE'
SEGMENT_SEPARATOR=''
collapse_pwd() {
echo $(pwd | sed -e "s,^$HOME,~," | sed "s@\(.\)[^/]*/@\1/@g")
}
prompt_segment() {
local bg fg
[[ -n $1 ]] && bg="%K{$1}" || bg="%k"
@vhuerta
vhuerta / mytheme.itermcolors
Last active July 17, 2017 13:08
My iTerm2 Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.098039217293262482</real>
@vhuerta
vhuerta / docker.sh
Last active March 29, 2017 04:49
Up and Running Docker on macos
# Install Docker
brew install Caskroom/cask/docker-toolbox
# Create a Docker machine named default
docker-machine create --driver virtualbox default
# Set ENV vars
eval "$(docker-machine env default)"
##
## Setup mongo
##
@vhuerta
vhuerta / connect_react_router_redux.js
Last active April 27, 2017 05:05
Connect react-router to redux container
import {connect} from 'react-redux';
import Component from 'component-path';
import actions from 'actions-path';
import {withRouter} from 'react-router-dom';
const mapStateToProps = (state, ownProps) => {
return {};
};