Skip to content

Instantly share code, notes, and snippets.

View zirosas's full-sized avatar

Jiro Sasamoto zirosas

View GitHub Profile
// use 'wp_before_admin_bar_render' hook to also get nodes produced by plugins.
add_action( 'wp_before_admin_bar_render', 'add_all_node_ids_to_toolbar' );
function add_all_node_ids_to_toolbar() {
global $wp_admin_bar;
$all_toolbar_nodes = $wp_admin_bar->get_nodes();
if ( $all_toolbar_nodes ) {
@zirosas
zirosas / Linux cmd
Last active December 19, 2015 22:28
find /path -name "name" -type d
sudo dpkg --get-selections > list.txt
~/.bashrc add at the end
export PS1="\[\e[36;1m\]\w \$ \[\e[0m\]"
gtk-update-icon-cache /usr/share/icons/hicolor
Problem: TinyMCE rich-text editor disables the operating system spellchecker when using Firefox or Chrome.
Solution: Set the TinyMCE configuration “gecko_spellcheck” to TRUE.
tinyMCE.init({
...
gecko_spellcheck : true
});
@zirosas
zirosas / pbcopy
Created November 17, 2013 00:42
pbcopy
pbcopy < ~/.ssh/id_rsa.pub
@zirosas
zirosas / gist:7760085
Created December 2, 2013 22:16
GIT: ignoring changes in tracked files
git update-index --assume-unchanged <file>
git update-index --no-assume-unchanged <file>
@zirosas
zirosas / locate svn binary
Created December 8, 2013 23:25
OS X Mavericks にsvnXをインストール
Unable to locate svn binary
×:/usr/local/bin
○/Applications/Xcode.app/Contents/Developer/usr/bin/
@zirosas
zirosas / OS X mySQL
Last active January 2, 2016 13:39
On OS X to start/stop/restart MySQL from the command line:
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
sudo /usr/local/mysql/support-files/mysql.server restart
@zirosas
zirosas / gist:8444740
Created January 15, 2014 21:09
Rails + MySQL on OSX : Library not loaded: libmysqlclient.18.dylib
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
@zirosas
zirosas / Ignoring versioned files
Last active January 3, 2016 12:39
Git lets you ignore those files by assuming they are unchanged.
This is done by running the git update-index --assume-unchanged path/to/file.txt command. Once marking a file as such, git will completely ignore any changes on that file; they will not show up when running git status or git diff, nor will they ever be committed.
To make git track the file again, simply run
git update-index --no-assume-unchanged path/to/file.txt.
https://help.github.com/articles/ignoring-files
@zirosas
zirosas / 0_reuse_code.js
Created February 2, 2014 20:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console