Skip to content

Instantly share code, notes, and snippets.

View symm's full-sized avatar
🦄

Gareth Jones symm

🦄
View GitHub Profile
@cakper
cakper / pre-commit
Created January 29, 2014 16:53
PHPSpec GIT pre-commit hook
#!/bin/sh
if [ -f ./bin/phpspec ]
then
./bin/phpspec run --quiet
if [ $? -ne 0 ]
then
echo "PHPSpec has failed - commit aborted"
return 1
fi
grep: /lib/modules/3.10.0-123.4.2.el7.x86_64/build/include/linux/version.h: No such file or directory
make KBUILD_VERBOSE=1 CONFIG_MODULE_SIG= -C /lib/modules/3.10.0-123.4.2.el7.x86_64/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo >&2 ; \
/bin/false)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
@sstok
sstok / ShortArraySyntaxFixer.php
Last active August 29, 2015 14:03
ShortArraySyntaxFixer for PHP-CS-Fixer
use Symfony\CS\FixerInterface;
use Symfony\CS\Tokens;
class ShortArraySyntaxFixer implements FixerInterface
{
public function fix(\SplFileInfo $file, $content)
{
$tokens = Tokens::fromCode($content);
for ($index = 0, $c = $tokens->count(); $index < $c; $index++) {
@wtnabe
wtnabe / .gitignore
Last active August 29, 2015 14:04
gulp + coffee + sass + watch + minify + cache buster sample
/node_modules
*.map
/bower_components
@adepasquale
adepasquale / image2spectrogram.py
Created August 30, 2014 18:30
image2spectrogram
#!/usr/bin/python
import cv2
import numpy as np
import wave
import struct
import sys
# usage instructions:
# ./image2spectrogram.py input.png
#!/usr/bin/env ruby
# -*- ruby -*-
# TODO: Intelligently find (maybe even install?) latest REE & passenger.
CONFIG_FLAGS="--with-http_secure_link_module"
REE_VERSION="ruby-enterprise-1.8.7-2010.01"
require 'open-uri'
@jaredatron
jaredatron / pinboard.in.bookmarklet.js
Created December 24, 2010 20:48
pinbaord.in bookmarklet
javascript:t='PUT YOUR TAGS HERE';q=location.href;p=document.title;void(t=open('http://pinboard.in/add?later=yes&noui=yes&jump=close&tags='+encodeURIComponent(t)+'&url='+encodeURIComponent(q)+'&title='+encodeURIComponent(p),'Pinboard','toolbar=no,width=100,height=100'));t.blur();
@p01
p01 / LICENSE.txt
Created October 6, 2011 17:11 — forked from 140bytes/LICENSE.txt
Mandelbrot fractal with zoom & panning in 133 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jakzal
jakzal / vm.sh
Last active October 1, 2015 20:24
Run commands on a Vagrant VM
#!/usr/bin/env bash
VM_PROJECT_DIR="/home/vagrant/project"
COMMAND="$1"
shift
run() {
vagrant ssh -c "cd $VM_PROJECT_DIR ; $*"
}
@purwandi
purwandi / deploy.rb
Created November 19, 2012 13:09
Laravel Capistrano Receipes
set :application, "App Name" # Your app name
set :repository, "git@github.com:xxxxx/xxx.git" # Your git repository
set :document_root, "/home/user/www/awesome_app"
set :deploy_via, :remote_cache
# SSH Settings
set :user, "user_ssh"
set :password, "password_ssh"
set :use_sudo, false