Skip to content

Instantly share code, notes, and snippets.

View shrwnsan's full-sized avatar
🏠
Working from home

shrwnsan

🏠
Working from home
View GitHub Profile
@ampledata
ampledata / gist:756753
Created December 28, 2010 01:04
this is a workaround for the "You don't exist, go away!" error on darwin
/usr/X11/bin/sessreg -w /var/run/utmpx -a $USER
@borgand
borgand / pow
Created June 23, 2011 15:50 — forked from ches/pow
A quick script to switch between running Pow and MacPorts Apache2 on OS X
#!/bin/sh -e
#/ Usage: pow [on|off]
#/ Toggle between running Pow (http://pow.cx) and Apache on Mac OS X.
# Show Usage
function usage {
grep '^#/' "$0" | cut -c4-
exit 2
}
[ -z "$1" -o "$1" = "--help" ] && usage
@ErneX
ErneX / gist:3179774
Created July 26, 2012 01:42
OS X Mountain Lion clean install & Rails
OS X Mountain Lion clean install Rails development environment setup using MySQL, imagemagick, homebrew and rvm. Rough steps, your mileage or your needs may vary:
- Install XCode from the App Store.
- Launch XCode > Preferences > Downloads > Install the Command Line Tools
- Install XQuartz version 2.7.2 http://xquartz.macosforge.org/trac/wiki/X112.7.2
- Install git, I used git-osx-installer version 1.7.11.3 http://code.google.com/p/git-osx-installer/downloads/list
- Install Ruby 1.9.3 with rvm, run this command on a terminal and follow the instructions: curl -L https://get.rvm.io | bash -s stable --ruby
- Install MySQL using the DMG installer, I used version 5.1.63 found here http://dev.mysql.com/downloads/mysql/5.1.html I use this to get the files needed for the mysql2 gem to install, I don't install the prefpane or the init script since I use MAMP as my MySQL server on my Mac.
- Install homebrew: https://github.com/mxcl/homebrew/wiki/installation
- Install ghostscript, from a terminal: brew install ghosts
@BronsonQuick
BronsonQuick / gist:3774261
Created September 24, 2012 05:05
Changes wp_link_pages to be an unordered list in WordPress
<?php /*
* Function similar to wp_link_pages but outputs an ordered list instead and adds a class of current to the current page
*/
function pico_link_pages( $args = '' ) {
$defaults = array(
'before' => '<p>' . __( 'Pages:' ), 'after' => '</p>',
'link_before' => '', 'link_after' => '',
'next_or_number' => 'number', 'nextpagelink' => __( 'Next page' ),
'previouspagelink' => __( 'Previous page' ), 'pagelink' => '%',
@billerickson
billerickson / gist:3714550
Created September 13, 2012 14:09 — forked from anonymous/gist:3712088
Sample Child Theme with Post Format
<?php
/** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );
/** Child theme (do not remove) */
define( 'CHILD_THEME_NAME', 'Sample Child Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/genesis' );
/** Add Viewport meta tag for mobile browsers */
add_action( 'genesis_meta', 'add_viewport_meta_tag' );
@jofralogo
jofralogo / responsiveMixinsF4.sass
Last active December 15, 2015 21:18
Useful responsive SCSS mixins for Foundation 4.
/*
_______
These simple SCSS/SASS mixins for Foundation 4 are made by me to deal with media-queries and have a clean code at the same time! ;)
****IMPORTANT****
Due to Foundation 4 uses mobile-first methodology, every $phone-"X" variable in these mixins defines the value for every screen size.
$desktop-"X" values overrides $phone-"X" values when the width of the window is 768px and above.
@Mine-Kira
Mine-Kira / gist:7303325
Created November 4, 2013 14:33
Git - do git fetch then rebase instead of git pull.
# instead of pull which does fetching and merging it to the current branch (which has diamond effects on commits nodes) you can use this.
# git fetch && git rebase remotename/branchname local_branchname
git fetch && git rebase origin/sprint1 sprint1
#update your local copy of remote repository by using fetch then rebase your localbranch to the remote repository copy (which is origin/sprint1) then checkout the local_branch which is sprint
@yocontra
yocontra / gulpfile.js
Last active January 1, 2016 00:29
gulpfile for a simple livereload static web server. this is a proof of concept that uses no plugins to do the work. obviously there are plugins that eliminate almost all of this code but i thought it would be a fun demonstration. this will trigger livereload any time any file is modified in the current working directory. it also serves the curre…
var gulp = require('gulp');
var gutil = require('gulp-util');
var express = require('express');
var path = require('path');
var tinylr = require('tiny-lr');
var createServers = function(port, lrport) {
var lr = tinylr();
lr.listen(lrport, function() {
gutil.log('LR Listening on', lrport);
@jamiew
jamiew / _mediacenter_setup.sh
Last active May 26, 2016 02:40
Checkout and launch SABnzbd+, CouchPotato and SickBeard on startup. Put the launchagent plist files in ~/Library/LaunchAgents
# you'll need homebrew too
cd Sites
git clone git://github.com/midgetspy/Sick-Beard.git sickbeard
# Probably need this:
# sudo easy_install cheetah
#
# test:
# python sickbeard/SickBeard.py
@fenbox
fenbox / gulpfile.js
Created December 29, 2013 11:48
sample gulp config: gulpfile.js
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var sass = require('gulp-sass');
var lr = require('tiny-lr'),
refresh = require('gulp-livereload'),
server = lr();