Skip to content

Instantly share code, notes, and snippets.

View mikedfunk's full-sized avatar

Mike Funk mikedfunk

View GitHub Profile
@xu-li
xu-li / laravel_orm_standalone.php
Last active August 29, 2015 14:04
Using laravel ORM alone
<?php
// composer.json
/*
{
"require": {
"illuminate/database": "*"
}
}
*/
@jerel
jerel / gist:4057007
Created November 12, 2012 01:05
One liner to create self signed ssl cert
$ mkdir ssl
$ cd ssl
$ openssl genrsa -out server.key 2048 && openssl req -new -key server.key -out server.csr && openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
// founded it posted in the comment section of some guy's blog
<!-- combine and minify js. add all js files to the first exec command. -->
<target name="compress_js" description="Combine javascript files to one file, compress with yui compressor.">
<tstamp />
<exec logoutput="true" checkreturn="true"
command="cat ${basedir}/assets/js/bootstrap.js ${basedir}/assets/js/bootstrap2.js > ${basedir}/build/tmp.js" />
<jsMin targetDir="${basedir}/assets/cache" suffix=".min.${DSTAMP}" failOnError="false">
<fileset dir="${basedir}/build">
<include name="tmp.js"/>
</fileset>
</jsMin>
@JeffreyWay
JeffreyWay / reflection.php
Created March 19, 2013 15:31
Test PHP protected/private methods with ease using Reflection.
<?php
// ...
public function testProtected()
{
$dateFormatter = new DateFormatter;
$class = new \ReflectionClass('DateFormatter');
var webdriver = require("selenium-webdriver");
var launchSelenium = require("selenium-launcher");
var selenium;
launchSelenium(function (err, _selenium) {
selenium = _selenium;
process.on('exit', function () {
selenium.kill();
});
});
@scrooloose
scrooloose / open_multiple.vim
Last active March 5, 2016 18:28
nerdtree plugin to open a visual selection of files
if exists("g:loaded_nerdtree_open_multiple")
finish
endif
let g:loaded_nerdtree_open_multiple=1
vnoremap <buffer> o :call <SID>OpenMultiple()<cr>
function! s:OpenMultiple() range
let curLine = a:firstline
while curLine <= a:lastline
@jdewit
jdewit / world.js
Last active March 24, 2016 23:39
world.js file for cucumberjs using phantomjs and protractor.
var assert = require('chai').assert,
path = require('path'),
browserName = process.env.browser || 'chrome',
protractor = require('protractor'),
webdriver = require('selenium-webdriver'),
exec = require('child_process').exec,
util = require('util')
;
var driver = new webdriver.Builder().usingServer('http://localhost:4444/wd/hub').withCapabilities(webdriver.Capabilities[browserName]()).build();
@cognitivegears
cognitivegears / searchresults.md
Last active October 25, 2016 02:01
Using Search Results Window with Unite and Anzu

Synopsis

With Unite and Anzu (and a little vimscript) it is possible to create a window showing all matching search results that appears automatically when searching.

See Search Results Window with Unite and Anzu for the code or below for a demonstration.

Search Windows

Usage

@uchida
uchida / dlclt.py
Created August 31, 2012 22:22
CUI Downloader of Command Line Tools for Xcode
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# CUI Downloader of "Command Line Tools for Xcode"
# by Akihiro Uchida, CC0 dedicated to the public domain
# see http://creativecommons.org/publicdomain/zero/1.0/
import sys, os
import urllib, urllib2, cookielib
from getpass import getpass
from HTMLParser import HTMLParser
@kattrali
kattrali / steps.md
Last active October 22, 2017 15:33
Configuring profanity.im for Hipchat on OS X

Configuring profanity.im for Hipchat on OS X

Installation

Easy

brew install profanity

  • The latest build available today via homebrew is 0.4.4 (which means no support for /occupants pane in rooms), and it does not support desktop notifications.