Skip to content

Instantly share code, notes, and snippets.

View quinn's full-sized avatar
🐁
huh

Quinn Shanahan quinn

🐁
huh
View GitHub Profile
default_access: &default_access
list: [all]
read: [all]
update: [owner, admin]
create: [all]
destroy: [owner, admin]
root:
activities:
attributes:
---
topics:
- name: '1.1b. Test Topic'
activities:
- name: 'Common Nouns'
rules:
- id: '1'
old_rule_id: '10'
explanation: 'Explanation text.'
questions:
def extract_app_in_dir(dir)
return unless remotes = git_remotes(dir)
current_app = false
begin
current_app = File.read(FileUtils.pwd + '/.current-heroku-app').chomp
rescue Errno::ENOENT
end
if remote = options[:remote]
@quinn
quinn / code.php
Created June 12, 2014 20:38
error output
<?php
register_shutdown_function('what_happened');
function what_happened () {
$reflFunc = new ReflectionFunction('ldap_escape');
echo "\nthe function location:\n";
echo $reflFunc->getFileName() . ':' . $reflFunc->getStartLine() . "\n";
var_dump($reflFunc);
echo "the error:\n";
echo var_dump(error_get_last());
@quinn
quinn / Gruntfile.js
Created June 14, 2014 18:11
Gruntfile for react and less
module.exports = function (grunt) {
var conf = {
browserify: {
options: {
transform: [ require('grunt-react').browserify ]
},
app: {
src: 'app/scripts/main.js', dest: 'dist/bundle.js'
}
},
@quinn
quinn / Dockerfile
Last active August 29, 2015 14:04
rails
# DOCKER-VERSION 0.9.0
FROM ruby:latest
MAINTAINER Quinn Shanahan q.shanahan@gmail.com
# http://www.activestate.com/blog/2014/01/using-docker-run-ruby-rspec-ci-jenkins
RUN apt-get install postgresql-client-common
EXPOSE 3000
@quinn
quinn / apache.conf
Last active August 29, 2015 14:04
Reason Standalone
Listen 5000
PidFile tmp/httpd.pid
LockFile tmp/accept.lock
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
@quinn
quinn / lossless-compression.sh
Last active August 29, 2015 14:22
lossless compression
find path/to/images -name "*.jpg" -exec sh -c "(jpegtran -optimize -copy none -outfile {}-compressed {} && mv {}-compressed {}) || echo ERROR: {}" \;
find path/to/images -name "*.png" -exec sh -c "optipng -o 3 {}" \;
class Object
# just a more verbose way of reversing predicates.
#
# lets you do things like
# ' '.not_blank? # => false
# instead of
# !' '.blank? # => false
# doesn't work sometimes if someone is using method_missing
# somewhere (i.e. rails)
def method_missing(method, *args, &block)
# $Id: svntouch.sh 602 2007-10-01 19:40:17Z galbrecht $
# $URL$
# svntouch.sh
# description
# touch a file and add it to svn
# this saves the steps fo having to do these two things manually:
# $ touch file
# $ svn add file
# usage
# requires at least one argument, the name of the file to touch & add