Skip to content

Instantly share code, notes, and snippets.

View beeman's full-sized avatar

beeman beeman

View GitHub Profile
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl | sh
<!-- The layout of the panel -->
<div id="feedback-grip">F</div>
<div id="feedback-panel">
<div class="feedbackit-form-elements">
<div style="padding: 15px; text-align: center;">This can be a form!</div>
<div style="padding: 15px; text-align: center; cursor: pointer;" id="close-link">Close me!</div>
beeman / gist:98c6beeafe24b86ac768
Created March 11, 2015 15:03
Working version of a cascading delete in a Loopback model definition
module.exports = function (Category) {
Category.observe('before delete', function (ctx, next) {
var Product =;
where: {
# Create swapfile
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
# Activate swapfile on boot
echo '# Activate swapfile on boot' >> /etc/fstab
echo '/swapfile none swap sw 0 0' >> /etc/fstab
# Alot of these configs have been taken from the various places
# on the web, most from here
# Set the colours you can use
beeman / git-diff-search
Created May 23, 2015 09:42
beeman / pre-commit
Last active August 29, 2015 14:23
Stop accidental commits to master | Add Pivotal Ticket ID based on branch name
# Stops accidental commits to master and develop.
# Copied from
# Install:
# cd path/to/git/repo
# curl -fL -o .git/hooks/pre-commit
# chmod +x .git/hooks/pre-commit
BRANCH=`git rev-parse --abbrev-ref HEAD`
➜ ~/workspace/scratch $ git clone
Cloning into 'loopback-example-pubsub'...
remote: Counting objects: 6691, done.
remote: Total 6691 (delta 0), reused 0 (delta 0), pack-reused 6691
Receiving objects: 100% (6691/6691), 8.63 MiB | 4.41 MiB/s, done.
Resolving deltas: 100% (1174/1174), done.
Checking connectivity... done.
➜ ~/workspace/scratch $ cd loopback-example-pubsub
➜ [master] ~/workspace/scratch/loopback-example-pubsub $ npm install
npm WARN package.json strong-pubsub-angular-loopback@1.0.0 No license field.
beeman / RelationsShell.php
Created November 18, 2013 23:46
Triggered by a post on Facebook ( I started working on a method to list all the models plus their relations of a CakePHP application.
App::uses('Shell', 'Console');
class RelationsShell extends Shell {
var $relations = array('hasMany', 'belongsTo', 'hasAndBelongsToMany');
var $structure = array();
Verifying that +beeman is my blockchain ID.