Skip to content

Instantly share code, notes, and snippets.

View revagomes's full-sized avatar
🦉

Reva Gomes revagomes

🦉
View GitHub Profile
<?php
$options['shell-aliases']['offline'] = 'variable-set -y --always-set maintenance_mode 1';
$options['shell-aliases']['online'] = 'variable-delete -y --exact maintenance_mode';
$options['shell-aliases']['sync-dbs'] = '!drush sql-sync --structure-tables-key=common --no-cache {{#prod}} {{@target}}';
$options['shell-aliases']['sync-files'] = '!drush rsync {{#prod}}:%files {{@target}}:%files';
$options['structure-tables']['common'] = array('cache', 'cache_filter', 'cache_menu', 'cache_page', 'history', 'sessions', 'watchdog');
$options['shell-aliases']['sync-fsdb'] = '!drush sql-sync {{#prod}} {{@target}} && drush rsync {{#prod}}:%files {{@target}}:%files';
@revagomes
revagomes / www-completion.sh
Created June 13, 2014 17:59
Adds the www shell comand to navigate to the /www folder
#!/bin/bash
# BASH completion script for www function.
#
# You must run this script as root in order to be able to create the _www file in the /etc/bash_completion.d/ directory.
if [ ! -f /etc/bash_completion.d/_www ]; then
printf '_www() {\nlocal dirs=("/www/$2"*/); [[ -e ${dirs[0]} ]] && COMPREPLY=( "${dirs[@]#/www/}" );\n}' >> /etc/bash_completion.d/_www;
fi
grep -qs _www /etc/bash_completion
<?php
/**
* @param tid
* Term ID
* @param child_count
* TRUE - Also count all nodes in child terms (if they exists) - Default
* FALSE - Count only nodes related to Term ID
*/
function term_nc($tid, $child_count = TRUE) {
$tids = array($tid);
// Animated throbber
html.js .form-autocomplete {
background-image: image-url('svg/throbber-inactive.svg');
background-position: 95% center;
background-position: -webkit-calc(100% - 5px) center;
background-position: calc(100% - 5px) center;
background-repeat: no-repeat;
}
html.js .throbbing {
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@revagomes
revagomes / addvhost
Last active August 29, 2015 14:11 — forked from marioheber/addvhost
#!/bin/bash
# This script creates virtual hosts.
# You should put export PATH="path to this file" in .bashrc
# and run it with sudo addvhost
# Default path
www=/var/www
@revagomes
revagomes / .editorconfig
Created December 29, 2014 22:13
Drupal editor configuration normalization
# Drupal editor configuration normalization
# @see http://editorconfig.org/
# This is the top-most .editorconfig file; do not search in parent directories.
root = true
# All files.
[*]
end_of_line = LF
indent_style = space
@revagomes
revagomes / Preferences.sublime-settings
Created December 30, 2014 13:28
My personal Sublime Text 3 settings
{
"bold_folder_labels": true,
"caret_style": "wide",
"theme": "Afterglow-blue.sublime-theme",
"color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme",
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"fallback_encoding": "UTF-8",