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 "[email protected]"

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 / 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 / gist:4284b2210ef76572218c73ba7d36a9a9
Created May 18, 2016 23:46 — forked from victor-falcon/gist:5093148
Load users by Role in Drupal 7
<?php
/**
* Users with role
*
* @param $role mixed The name or rid of the role we're wanting users to have
* @param $active_user boolean Only return active accounts?
*
* @return array An array of user objects with the role
*/
function users_with_role($role, $active_user = TRUE) {
@jqn
jqn / react-native-gitignore
Created July 28, 2016 18:18 — forked from ryantbd/react-native-gitignore
react-native-gitignore
# Most part of this file is created by https://www.gitignore.io
### Node ###
# Logs
logs
*.log
# Runtime data
pids
*.pid
@jqn
jqn / gist:517d2d2a6569df9ee59511f6af8aa572
Created December 9, 2016 18:55 — forked from chrissimpkins/gist:5bf5686bae86b8129bee
Atom Editor Cheat Sheet (Sweetmeat)

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key