Skip to content

Instantly share code, notes, and snippets.

View peebeebee's full-sized avatar

Peter Briers peebeebee

View GitHub Profile
@peebeebee
peebeebee / LICENSE
Last active August 29, 2015 14:27 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@peebeebee
peebeebee / gist:a27468df8aaca92fefc3
Created June 26, 2015 09:00
Handy Shell Functions
# .bash_profile
# Type `up 7` to do cd ../../../../../../..
function up() {
i=$1
while [ $i -gt 0 ]
do
cd ..
i=$(($i - 1))
done
}
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
log = function(arg) {
// By observing changes to an object with Object.observe,
// and turning on Async Call Stacks in Chrome Dev Tools,
// you can find the source of those changes.
var myObject = {
foo: 'bar'
};
Object.observe(myObject, function(changes) {
// This asynchronous callback runs when myObject is changed
@peebeebee
peebeebee / 0_reuse_code.js
Created July 1, 2014 07:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Index: content/plugins/wp-tell-a-friend-popup-form/wp-tell-a-friend-popup-form.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- content/plugins/wp-tell-a-friend-popup-form/wp-tell-a-friend-popup-form.php (date 1403968273000)
+++ content/plugins/wp-tell-a-friend-popup-form/wp-tell-a-friend-popup-form.php (revision )
@@ -49,36 +49,36 @@
<?php
}
@peebeebee
peebeebee / gist:76a07b711b9da0120c76
Created May 15, 2014 10:02
Help & Support Alpha version theming
.page-help-and-support {
#content-inner {
width: auto;
}
.hs-bar {
position: relative;
overflow: hidden;
@peebeebee
peebeebee / Capistrano
Created March 3, 2014 04:56
Capistrano
bundle exec cap production git:check --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke git:check (first_time)
** Invoke git:wrapper (first_time)
** Execute git:wrapper
INFO [0e2870b7] Running /usr/bin/env mkdir -p /tmp/leukemissie/ on myhost.com
D, [2014-03-03T05:52:29.674278 #16552] DEBUG -- net.ssh.transport.session[3fc5a541b75c]: establishing connection to myhost.com:22
@peebeebee
peebeebee / gist:9176850
Created February 23, 2014 20:33
Exit shell on error
#!/bin/sh -e
/*
When this option is on, if a simple command fails for any of the reasons listed in Consequences of Shell Errors or returns an exit status value >0, and is not part of the compound list following a while, until, or if keyword, and is not a part of an AND or OR list, and is not a pipeline preceded by the ! reserved word, then the shell shall immediately exit.
*/