Skip to content

Instantly share code, notes, and snippets.

View energee's full-sized avatar
:atom:
Coding

Ted Slesinski energee

:atom:
Coding
View GitHub Profile
@energee
energee / appify
Created April 25, 2012 15:39 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@energee
energee / gitlab.sh
Last active December 10, 2015 01:38 — forked from drucko/gitlab.sh
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.3-full rubygems1.9.3
aptitude install -y mysql-server libmysqlclient-dev
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
adduser --disabled-login --gecos 'gitlab system' gitlab
usermod -a -G git gitlab
su - gitlab
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
aptitude install gitolite
cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
su - git
@energee
energee / image.js
Last active December 14, 2015 14:19
Alt text checking for ckeditor
/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/ (function () {
var imageDialog = function (editor, dialogType) {
// Load image preview.
var IMAGE = 1,
LINK = 2,
PREVIEW = 4,
CLEANUP = 8,
@energee
energee / .gitignore
Last active December 15, 2015 20:29
Drupal .gitignore
# Ignore configuration files that may contain sensitive information.
sites/*/settings*.php
# Ignore paths that contain user-generated content.
sites/*/files
sites/*/private
# Ignore sublime project and development files
*.sublime-projectcompletions
*.sublime-project
@energee
energee / live-git-pull-task.sh
Last active December 16, 2015 15:59 — forked from dkinzer/live-git-pull-task
Git live pull
#live git pull
drush dd @alias:%git-dir
drush dd @alias:%work-tree
drush @alias exec git fetch origin
drush @alias exec git merge origin/master
@energee
energee / list.sh
Last active December 17, 2015 07:49
Print file permissions in number output
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o",k);print}'
@energee
energee / config.rb
Created May 24, 2013 21:19
Compass config.rb base
# Change this to :production when ready to deploy the CSS to the live server.
environment = :development
#environment = :production
# In development, we can turn on the FireSass-compatible debug_info.
firesass = false
#firesass = true
# Location of the theme's resources.
@energee
energee / install codesniffer
Created June 5, 2013 20:09
Install CodeSniffer for SublimeText 2
# Install Codesniffer.
$ sudo pear install PHP_CodeSniffer
# Ensure the bin folder's $PATH is set, check by executing '$ which phpcs'.
# Download drupal standards to a dropbox folder via git
# this way, a git pull to this folder will be able to upgrade coder.
# (From sync folder)
$ git clone --branch 7.x-2.x http://git.drupal.org/project/coder.git
@energee
energee / headers.module
Created June 12, 2013 18:07
Requests headers with Drupal
<?php
// Get the url.
$url = 'someurl';
// Ping the domain.
$request = drupal_http_request($url);
// Grab the headers form the object and set.
$headers = $request->headers;
// Drupal print.
dpm($headers);
@energee
energee / Enable performance settings
Created June 12, 2013 23:00
Enables Drupal Caching for production.
// Cache pages for anonymous.
variable_set('cache', 0);
// Enable block caching.
variable_set('block_cache', TRUE);
// Minimum cache time - none.
variable_set('cache_lifetime', 0);
// Cache expiry 15 minutes.
variable_set('page_cache_maximum_age', '900');
// Page compression on.
variable_set('page_compression', TRUE);