Skip to content

Instantly share code, notes, and snippets.

View revagomes's full-sized avatar
🦉

Reva Gomes revagomes

🦉
View GitHub Profile
@revagomes
revagomes / .profile_example
Created June 8, 2011 18:58
.profile aliases and functions
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Directory navigation aliases
alias ..='cd ..'
alias ...='..;..'
alias ....='..;..;..'
alias .....='..;..;..;..'
@revagomes
revagomes / batch_api_example.module
Created December 18, 2012 16:04
Drupal Batch API Example
<?php
function skeleton_menu() {
$items['admin/skeleton/batch'] = array(
'title' => 'Skeleton Batch',
'page callback' => 'skeleton_batch_init',
'access arguments' => array('Administer content'),
'type' => MENU_NORMAL_ITEM,
);
@revagomes
revagomes / a2catchall
Last active December 14, 2015 00:09
Catchall config for local virtualhosts on Apache.
<VirtualHost *:80>
ServerAlias localhost *.l #wildcard catch all
VirtualDocumentRoot /var/www/%1/
UseCanonicalName Off
<Directory "/var/www">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
@revagomes
revagomes / Sublime User Preferences
Last active December 26, 2015 07:08
My personal sublime user preferences.
{
"bold_folder_labels": true,
"caret_style": "wide",
"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",
"find_selected_text": true,
#!/bin/sh
#
# For each ref, validate the commit.
#
# - It disallows deleting branches without a /.
# - It disallows non fast-forward on branches without a /.
# - It disallows deleting tags without a /.
# - It disallows unannotated tags to be pushed.
@revagomes
revagomes / gist:0e91739397fbd81bab14
Last active August 29, 2015 14:01
Drupal Entity Construction Kit (ECK) code example
<?php
/**
* Implements hook_install().
*/
function power_one_install() {
// The "generation_site" entity type already exists at this point.
// Create a new entity bundle using ECK's API.
$new_bundle = function($name, $label, $entity_type) {
@revagomes
revagomes / pre-commit
Created May 6, 2014 20:37 — forked from skwashd/pre-commit
Git pre-commit hook for checking files with coder-review and php lint. This prevents developers committing broken PHP or code that doesn't comply with the Drupal coding standards.Add this file to .git/hooks/pre-commit in the root of your doc repo and make it executable (chmod +x .git/hooks/pre-commit).You must have the coder module in ~/.drush/T…
#!/bin/bash
#
# Git pre-commit hook for Drupal projects.
# Created by Dave Hall - http://davehall.com.au
# Distributed under the terms of the WTFPL - http://www.wtfpl.net/
#
set -e
#!/bin/bash
##########################################################################
#
# mysql_backups.sh: A shell script to back up all MySQL databases in
# one shot, nightly, and keep a rolling 3 weeks of
# backups hot, online in the backup archive.
#
# Written by David A. Desrosiers
# Contact desrod@gnu-designs.com
# Last updated Jun 27 2012 by Alessandro Feijó @afeijo
@revagomes
revagomes / recursive_compass_cc.sh
Created June 1, 2014 23:09
Cleans and compiles sass files via compass on every occurence of a config.rb file
find `pwd` -name config.rb | sed 's/config.rb//' | sed 's/^/cd /' | sed 's/$/;compass clean;compass compile/' | xargs -n4 | sh
<?php
$adam = array(
'remote-host' => 'adammalone.net',
'root' => '/var/www/html/adammalone/docroot',
'uri' => 'adammalone.net',
'strict' => 0,
'path-aliases' => array(
'%dump-dir' => '/home/adammalone/.drush/dumps',
'%files' => 'sites/default/files',