Skip to content

Instantly share code, notes, and snippets.

View siffring's full-sized avatar

Jason Siffring siffring

View GitHub Profile
@jtallant
jtallant / vagrant-demo.md
Last active August 29, 2015 14:02
vagrant-demo

Generate an SSH Key

You probably already have a public and private key. Check and make sure.

ls -a ~/.ssh | grep id

=> id_rsa
=> id_rsa.pub

@ianbarber
ianbarber / calcreate.php
Created November 28, 2012 12:19
Create hangout link via calendar
<?php
/*
* example usage:
* First call to get the url
* php calcreate.php
* After authorising, grab the code from the redirect URL
* php calcreate.php "long_code_value_from_oauth_callback"
* This will var_dump out the new calendar entry
*/
require_once 'google-api-php-client/src/Google_Client.php';
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@ckimrie
ckimrie / gist:3312619
Created August 10, 2012 08:32
Example extension that allows you to modify the final ExpressionEngine CP output
<?php
/**
* Modifying the final CP Output
*
* This extension demonstrates how you can access and modify the final ExpressionEngine
* CP output. It is not a hack, but it is a new technique that to my knowledge has not
* been used before in an EE addon.
*
* This has not been road tested and its side effects are unknown, so use this at your own risk.
@thetristan
thetristan / git-fresh
Created May 23, 2012 23:17
Quick shell script to check the freshness of your git branches
#!/bin/bash
# ## git-fresh
#
# Author: Tristan Blease <tristan@bleaseinteractive.com>
# Website: tristanblease.com
# License: http://www.opensource.org/licenses/MIT
#
# Quick shell script to check the freshness of your git repository branches
#
@amacneil
amacneil / no_more_msm.php
Created April 5, 2012 03:36
Extract a single ExpressionEngine site from a MSM install
<?php
/*
* Instructions:
* First add your database connection details below.
* Then either upload this script to your server and visit the page,
* or run it using the command line: php no_more_msm.php
*/
// database connection details
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@brandonkelly
brandonkelly / gist:1671737
Created January 24, 2012 18:27
Cross-compatible get_upload_preferences() for EE 2.0 thru 2.4
<?php
/**
* Get Upload Preferences (Cross-compatible between ExpressionEngine 2.0 and 2.4)
* @param int $group_id Member group ID specified when returning allowed upload directories only for that member group
* @param int $id Specific ID of upload destination to return
* @return array Result array of DB object, possibly merged with custom file upload settings (if on EE 2.4+)
*/
function get_upload_preferences($group_id = NULL, $id = NULL)
{
@manifestuk
manifestuk / Find EE Extension Hooks
Created January 14, 2012 01:15
Output a list of every extension hook for a given ExpressionEngine installation
# Description:
# A couple of useful bash one-liners for finding all of the extension hooks in
# a given ExpressionEngine installation. Here's what it does:
#
# 1. Finds all of the native hooks, and any third-party hooks;
# 2. Sorts them alphabetically;
# 3. Outputs them to STDOUT or a file of your choosing.
#
# Usage:
# CD to the `/system/expressionengine/` directory of your site, and run
@imagehat
imagehat / gist:1418214
Created December 1, 2011 17:02
EE snippet for appending read more link inside last closing html tag
{exp:low_replace
regex="yes"
find="(<\/(.*)>)(\s+)$"
replace="SPACE<a class='more' href='{title_permalink=bulletin}'>[read more]</a>$1"
}
{blog_excerpt}
{/exp:low_replace}