Skip to content

Instantly share code, notes, and snippets.

View mikedugan's full-sized avatar

Mike Dugan mikedugan

View GitHub Profile
@mikedugan
mikedugan / func.swift
Created February 14, 2015 02:35
swift func
func createHtmlLink(linkTitle title: String = "Click Me", href: String = "#", #titleFormatter: (String) -> String) -> String
{
return "<a href=\"\(href)\">\(titleFormatter(title))</a>"
}
### Keybase proof
I hereby claim:
* I am mikedugan on github.
* I am mikedugan (https://keybase.io/mikedugan) on keybase.
* I have a public key whose fingerprint is 2CDF DFD0 1DFA ED69 2090 1A9C 4570 22C0 A4FF C8DF
To claim this, I am signing this object:
@mikedugan
mikedugan / docksep.sh
Created November 10, 2014 21:49
OS X Dock Seperator
alias docksep=docksep
docksep() {
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
killall Dock
}
// This is what you might have right now
Route::get('users/{id}', 'UserController@getProfile')->where('id', '[\d+]+');
Route::get('products/{id}', 'ProductController@getProfile')->where('id', '[\d+]+');
Route::get('articles/{slug}', 'ArticleController@getFull')->where('slug', '[a-z0-9-]+');
Route::get('faq/{slug}', 'FaqController@getQuestion')->where('slug', '[a-z0-9-]+');
// and many more, now imagine you'll have to change the rule
// Instead, you could have a handy list of patterns and reuse them everywhere:
// Patterns
Route::pattern('id', '\d+');
@mikedugan
mikedugan / allglyphicons.less
Created June 23, 2014 01:52
LESS file for all 4 glyphicon sets from http://glyphicons.com. Provides some basic color and size support.
/*!
*
* All glyphicons must be licensed for use according to http://glyphicons.com/license/
* This file does not include any fonts or other assets and is only for developers who have purchased Glyphicons
*
* License: MIT
*
*/
// IMPORT FONTS
@mikedugan
mikedugan / gulpfile.js
Created June 23, 2014 01:44
Basic gulpfile setup to minify images, LESS/CSS, and JS
var gulp = require('gulp');
var rimraf = require('rimraf');
var less = require('gulp-less');
var concat = require('gulp-concat');
var prefixer = require('gulp-autoprefixer');
var cssmin = require('gulp-minify-css');
var jsmin = require('gulp-uglify');
var watch = require('gulp-watch');
var util = require('gulp-util');
var rename = require('gulp-rename');
@mikedugan
mikedugan / free.py
Created June 21, 2014 19:59
command line memory report for Mac OS X
#!/usr/bin/python
#obviously, this requires python to be installed
#sudo chmod +x free.py && sudo mv free.py /usr/bin/free
#allows you to access it as a regular command
import subprocess
import re
# Get process info
server {
listen 80;
server_name YOUR_DOMAIN;
server_name_in_redirect off;
access_log /var/log/nginx/localhost.access_log main;
error_log /var/log/nginx/localhost.error_log info;
root PATH_ON_SERVER;
index index.php index.html index.htm default.html default.htm;
@mikedugan
mikedugan / bscs.txt
Created June 14, 2014 14:14
bootstrap cheat sheet (very dense
This Document
Assumes you have a basic knowledge of emmet-style coding, it was used to abbreviate much of this. Any time you see a pipe(|), it is indicating you can select one of a group of elemnts. Any time you see a ? preceding something, it means it is optional.
CS=(success|info|warning|danger)
CL=(primary|default|CS)
SZ=(lg|sm|xs)
All information retrieved from:
http://getbootstrap.com/
@mikedugan
mikedugan / webstack.bash
Created May 20, 2014 23:43
Script to install Apache 2.2, PHP 5.5, MySQL 5.5 on CentOS 6
#!/bin/bash
yum update -y
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
yum --enablerepo=remi,remi-php55 install -y mysql mysql-server php httpd php-mbstring php-mysql php-gd php-mcrypt curl php-xml php-xmlrpc php-cli
chkconfig --levels 235 mysqld on
chkconfig --levels 235 httpd on
/etc/init.d/mysqld start