Skip to content

Instantly share code, notes, and snippets.

View rmsj's full-sized avatar

Ronaldo Santana rmsj

  • Auckland, New Zealand
View GitHub Profile
@rmsj
rmsj / scrool_top_jquery.js
Last active December 17, 2015 00:49
Scrool top with jquery and a link
jQuery(document).ready(function() {
jQuery('a.back_top_link').click(function(){
jQuery('html, body').animate({scrollTop:0}, 'slow');
return false;
});
});
@rmsj
rmsj / spotlight
Created June 29, 2014 19:41
Hide/show spotlight icon
# to hide:
sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
killall SystemUIServer
# to show uncomment lines:
# sudo chmod 755 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
# this will refresh things
# killall SystemUIServer
Language Packages
----
Extensions handled URL
CSharp .cs, .csx, .build https://atom.io/packages/language-csharp
SQL .sql https://atom.io/packages/language-sql
ASPX .aspx, .ascx, .ashx https://atom.io/packages/language-aspx
Vbdotnet .vb https://atom.io/packages/language-vbdotnet
Other Packages
----
@rmsj
rmsj / table_field_dependencies
Created March 30, 2015 02:38
Get all tables that reference a table.field on PostgreSQL
select R.*
from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE u
inner join INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS FK
on U.CONSTRAINT_CATALOG = FK.UNIQUE_CONSTRAINT_CATALOG
and U.CONSTRAINT_SCHEMA = FK.UNIQUE_CONSTRAINT_SCHEMA
and U.CONSTRAINT_NAME = FK.UNIQUE_CONSTRAINT_NAME
inner join INFORMATION_SCHEMA.KEY_COLUMN_USAGE R
ON R.CONSTRAINT_CATALOG = FK.CONSTRAINT_CATALOG
AND R.CONSTRAINT_SCHEMA = FK.CONSTRAINT_SCHEMA
AND R.CONSTRAINT_NAME = FK.CONSTRAINT_NAME
@rmsj
rmsj / setup_selenium.sh
Created October 20, 2015 21:36 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
@rmsj
rmsj / git_prompt_info.zsh
Created November 12, 2015 06:46 — forked from msabramo/git_prompt_info.zsh
The slowness of my zsh prompt when in a git-svn managed directory was killing me. I improved it by removing the git status stuff that slows it down...
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
@rmsj
rmsj / 0_reuse_code.js
Created November 30, 2015 20:40
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
@rmsj
rmsj / mac_terminal_shortcuts.md
Last active January 11, 2016 19:34
Mac terminal shortcut

On Mac OS X - the following keyboard shortcuts work by default. Note that you have to make Option key act like Meta in Terminal preferences (under keyboard tab)

alt ⌥+F to jump Forward by a word alt ⌥+B to jump Backward by a word I have observed that default emacs key-bindings for simple text navigation seem to work on bash shells. You can use

  • Meta-d to delete a word starting from the current cursor position
  • ctrl+A to jump to start of the line
  • ctrl+E to jump to end of the line
  • ctrl+K to kill the line starting from the cursor position
@rmsj
rmsj / xdebug-install-php7
Created January 27, 2016 01:27 — forked from kamilZ/xdebug-install-php7
Install xdebug from sources php7.0
sudo apt-get install php7.0-dev
wget http://xdebug.org/files/xdebug-2.4.0rc2.tgz
tar -xzf xdebug-2.4.0rc2.tgz
cd xdebug-2.4.0RC2/
phpize
./configure --enable-xdebug
make
sudo cp modules/xdebug.so /usr/lib/.
#FOR FPM
sudo echo 'zend_extension="/usr/lib/xdebug.so"' > /etc/php/7.0/fpm/conf.d/20-xdebug.ini
@rmsj
rmsj / docker_auto_complete
Created July 10, 2017 10:19
Docker auto complete on zsh
mkdir ~/.zsh/completion
curl -L https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/plugins/docker/_docker > ~/.zsh/completion/_docker
curl -L https://raw.githubusercontent.com/docker/machine/master/contrib/completion/zsh/_docker-machine > ~/.zsh/completion/_docker-machine
curl -L https://raw.githubusercontent.com/docker/compose/master/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose
Include the directory in your $fpath, e.g. by adding in ~/.zshrc:
fpath=(~/.zsh/completion $fpath)
Make sure compinit is loaded or do it by adding in ~/.zshrc: