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 / gist:9550287
Last active August 29, 2015 13:57
New directory to looks for templates
<?php
function MYTHEME_theme($existing, $type, $theme, $path) {
$template_path = drupal_get_path('theme', 'MYTHEME') .'/templates';
return drupal_find_theme_templates($existing, '.tpl.php', $template_path);
}
(function ($) {
Drupal.behaviors.megamenu = {
attach: function (context, settings) {
(function(){
var mainNav = {};
// common stuff
@energee
energee / gist:74d4cf7fb917cab6b7e0
Created December 1, 2014 22:18
Log into MySQL Root without password
# kill the running mysql process
sudo service mysql stop
# start mysql in safe mode and skip grant tables
sudo mysqld_safe --skip-grant-tables --skip-networking &
# log in with root
mysql -u root
# ( optional ) flush privileges, create new user, grant privileges
@energee
energee / gist:07f27f1ce3e7c73a9d3a
Created January 27, 2015 23:41
Install Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X Mavericks or Yosemite
Xcode
First of all, get the latest Xcode version (6.1) via the Mac App Store:
Download Xcode.app (via Mac App Store)
As soon as you have finished the download, open Xcode in your /Applications folder and agree to the licence.
Open a new Terminal window and install the Xcode Command Line Tools:
@energee
energee / gist:fb2717892a5b237fd786
Last active August 29, 2015 14:18
Center anything vertically in css (ie9+)
object {
position: relative;
top: 50%;
transform: translateY(-50%);
}
.parent-element {
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
@energee
energee / css
Last active August 29, 2015 14:22
Media object
.media {margin:10px;}
.media, .bd {overflow:hidden; _overflow:visible; zoom:1;}
.media .img {float:left; margin-right: 10px;}
.media .img img{display:block;}
.media .imgExt{float:right; margin-left: 10px;}
@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