Skip to content

Instantly share code, notes, and snippets.

View countless-integers's full-sized avatar

Adrian countless-integers

View GitHub Profile
@countless-integers
countless-integers / objectElipsis.js
Created March 4, 2016 08:07
object values elipsis using lodash
if (typeof _ !== 'function') {
throw new Error('This is only intended for lodash use');
}
// "test" object
var obj = {
name: {
last: "Hello",
nofd: ['nope', 'hoope'],
},
@countless-integers
countless-integers / delete_branches_older_than.sh
Last active April 10, 2020 13:26 — forked from antonio/delete_branches_older_than.sh
Script to delete branches older than a certain date
#!/bin/bash
dry_run=0
usage()
{
cat << EOF
usage: $0 [-n] ["string_to_date"]
Remove branches older than specified, human-readable date passed as a param
@countless-integers
countless-integers / listBranchesAge.sh
Last active January 14, 2016 08:57
listing git branches with their age ordered from oldest
for k in `git branch -a | grep origin | grep -v HEAD | sed s/^..//`; do
echo -e `git log -1 --pretty=format:"%ci %cr" "$k"`\\t"$k";
done | sort
@countless-integers
countless-integers / PHP memoization test #1
Created May 26, 2015 14:42
PHP memoization test using static function var
<?php
class Broom
{
public function rememberMe()
{
static $outcome;
if ($outcome) return $outcome;
return $outcome = rand();
}
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
Tail project log
OPTIONS: