Skip to content

Instantly share code, notes, and snippets.

View piclez's full-sized avatar

Peter WD piclez

View GitHub Profile
Warning: require(/var/www/public/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/public/index.php on line 24
Fatal error: require(): Failed opening required '/var/www/public/../vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/public/index.php on line 24
@piclez
piclez / docker-cleanup.sh
Created October 11, 2016 21:45
docker-cleanup.sh
#!/bin/bash
# Remove exited containers
for exited in $(docker ps -a | grep Exited | cut -d ' ' -f 1); do
docker rm $exited;
done
# Remove intermediate images
for img in $(docker images | grep "<none>" | awk "{print \$3}"); do
docker rmi -f $img;
@piclez
piclez / gomongohql.go
Created May 10, 2016 03:29 — forked from IndianGuru/gomongohql.go
gomongohql.go
package main
import (
"fmt"
"html/template"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"log"
"net/http"
"os"
@piclez
piclez / .pryrc
Created February 2, 2016 00:38
pryrc
if defined?(Pry || PryDebugger)
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
end
@piclez
piclez / series.rb
Created December 1, 2015 01:14
ElasticSearch/Searchkick with custom mappings and analyzer
searchkick callbacks: :async,
word_start: [:name, :customer_name, :studio_name],
merge_mappings: true,
settings: {
analysis: {
analyzer: {
custom_chars: {
type: 'custom',
tokenizer: 'whitespace',
filter: ['lowercase', 'custom_filter']
@piclez
piclez / .profile
Created November 6, 2015 20:00
.profile
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
alias gst="git status"
alias gpr="git pull --rebase"
alias dev="git checkout develop"
@piclez
piclez / gist:f5e32ce6c060e2e5152e
Last active August 29, 2015 14:02
Mac commands
find . -name '*.DS_Store' -type f -delete
cd /opt/boxen/rbenv/plugins/ruby-build/ && git pull
@piclez
piclez / queue.js
Created November 16, 2010 18:25 — forked from dominictarr/queue.js
var sys = require('sys'),
exec = require('child_process').exec;
// fs = require('fs');
// ecsv = require('ecsv')
function Queue () {
var waiting = [];
this.max = -1;
this.current = 0;
//run checks if we're under the max processors, and runs if there is room.
@piclez
piclez / tmp.rb
Created November 16, 2010 18:25 — forked from vvs/tmp.rb
require 'tempfile'
require 'java' if defined?(JRUBY_VERSION)
require 'test/unit'
require 'fileutils'
class TestTempfilesCleanUp < Test::Unit::TestCase
def setup
@tmpdir = "tmp_#{$$}"
Dir.mkdir @tmpdir rescue nil
thor merb:gem:list
Installed local gems:
~ ParseTree-3.0.2
~ RubyInline-3.8.1
~ ZenTest-3.11.0
~ abstract-1.0.0
~ addressable-1.0.4
~ data_objects-0.9.6
~ dm-aggregates-0.9.6
~ dm-core-0.9.6