Skip to content

Instantly share code, notes, and snippets.

View jqn's full-sized avatar

Joaquin Guardado jqn

View GitHub Profile

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@jqn
jqn / string-incrementer.js
Created January 8, 2015 18:34
JS String Incrementer
/*
Your job is to write a function which increments a string, to create a new string.
If the string already ends with a number, the number should be incremented by 1.
If the string does not end with a number the number 1 should be appended to the new string.
Examples:
foo -> foo1
foobar23 -> foobar24

This guide shows how to set up a PHP and MySQL development environment using OSX's built-in Apache, using Homebrew to install necessary components. With this strategy, you can use different versions of PHP for certain virtual hosts.

VirtualHostX is a convenient way to manage development sites, but not required.

Install PHP and MySQL with Homebrew

brew update
brew install php56
brew install php56-mcrypt
brew install mysql
@jqn
jqn / apache.txt
Created January 25, 2015 06:30
apache
<?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>Disabled</key>
<true/>
<key>Label</key>
<string>org.apache.httpd</string>
<key>EnvironmentVariables</key>
<dict>
@jqn
jqn / demo.module
Last active August 29, 2015 14:15 — forked from pascalduez/demo.module
<?php
/**
* @file
* Demo module, Basic Ajax form submit (Ajax framework).
*/
/**
* Implements hook_menu().
*/
@jqn
jqn / launch_sublime_from_terminal.markdown
Created November 14, 2015 02:26 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@jqn
jqn / field.tpl.php
Created November 23, 2015 20:10 — forked from jacine/field.tpl.php
My default hook_preprocess_field() and field.tpl.php
<?php
/**
* Implements template_preprocess_field().
*/
function THEME_preprocess_field(&$vars) {
// If the view mode is "full" use <h2> for the field labels. Otherwise,
// assume a teaser or more compact view mode is being displayed, and use <h3>.
$vars['heading'] = ($vars['element']['#view_mode'] == 'full') ? 'h2' : 'h3';
@jqn
jqn / iterm2.md
Created December 16, 2015 20:26
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
@jqn
jqn / .gitignore
Created March 30, 2016 04:29 — forked from FullStackForger/.gitignore
Wordpress .gitignore file
# -----------------------------------------------------------------
# Minimalistic .gitignore for WordPress
#
# To get this file rub bellow wget command from project root directory
# wget -O .gitignore https://gist.github.com/indieforger/d915d8b430fef748f966/raw
#
# To ignore uncommitted changes in a file that is already tracked,
# use `git update-index --assume-unchanged`.
#
# To stop tracking a file that is currently tracked,
@jqn
jqn / web-developer-jqn.md
Last active May 14, 2016 19:58
jqn-developer resume