Skip to content

Instantly share code, notes, and snippets.

View dbarbar's full-sized avatar

David Barbarisi dbarbar

View GitHub Profile
# you'd obviously have more settings somewhere
set :repository, "[email protected]:defunkt/github.git"
set :branch, "origin/master"
namespace :deploy do
desc "Deploy the MFer"
task :default do
update
restart
cleanup
@brianjlandau
brianjlandau / gist:176754
Created August 28, 2009 02:59 — forked from defunkt/gist:162444
Rails Capistrano deploy using git as our deployment strategy. You'll need git version >=1.5.6.6 on your server for this to work.
# you'd obviously have more settings somewhere
set :scm, :git
set :repository, "[email protected]:defunkt/github.git"
set :branch, "origin/master"
set :migrate_target, :current # this tells capistrano where to run the migration. otherwise it would try to use the latest release directory (/path/to/app/releases/2012XXXXXXXXX)
set :use_sudo, false
set :ssh_options, {:forward_agent => true} # so you can checkout the git repo without giving the server access to the repo
set :rails_env, 'production'
# These are here to override the defaults by cap
# --------------------------------------------
# General
# --------------------------------------------
set :shared_children, %w(cache logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments.
set :application, "domain.com" # Application name
set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ...
# --------------------------------------------
# Server
# --------------------------------------------
@febuiles
febuiles / hubot.sh
Created November 25, 2011 22:02
Hubot startup script
#!/bin/sh
# This assumes you have:
# 1) A user called `hubot` in charge of the bot.
# 2) A file called /home/hubot/.hubotrc that contains the Hubot credentials.
#
# To set the adapter either edit bin/hubot to specify what you want or append
# `-- -a campfire` to the $DAEMON variable below.
#
### BEGIN INIT INFO
@mager
mager / sp.models.player.track.js
Created January 5, 2012 18:45
Spotify Apps API - Get the currently playing track
sp = getSpotifyApi(1);
var models = sp.require('sp://import/scripts/api/models');
var currentTrack = models.player.track;
console.log(currentTrack);
@lsolesen
lsolesen / .travis.yml
Created August 13, 2012 11:18
Travis CI-integration for a Drupal 7 installation profile
language: php
php:
- 5.3
mysql:
database: drupal
username: root
encoding: utf8
@danny-englander
danny-englander / jquery.responsive-classes.js
Created September 13, 2012 00:16
JQuery Responsive Classes
/*
* Inspired by:
* http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery
*
* This script is ideal for getting specific class depending on device width
* for enhanced theming. Media queries are fine in most cases but sometimes
* you want to target a specific JQuery call based on width. This will work
* for that. Be sure to put it first in your script file. Note that you could
* also target the body class instead of 'html' as well.
* Modify as needed

Install XHProf

Pear

pear upgrade PEAR
pecl install xhprof-0.9.2

MAMP

@pcave
pcave / gist:9532353
Created March 13, 2014 16:58
Submit a VBO action with simpletest
<?php
// Create and log in a user that has access to the queue log report.
$this->privileged_user = $this->drupalCreateUser(array(
'view salesforce batch logs',
));
$this->drupalLogin($this->privileged_user);
$this->drupalGet('admin/reports/salesforce/queue');
$this->assertNoOptionSelected('edit-operation', 'action::salesforce_queue_salesforce_queue_item_refresh_item_action', 'Refresh VBO action exists but is not selected.');