Skip to content

Instantly share code, notes, and snippets.

View Zearin's full-sized avatar

Zearin Zearin

  • Virginia, U.S.A.
View GitHub Profile
@caruccio
caruccio / bash-named-param
Created April 24, 2012 03:25
Named parameters in bash
# Do you like python named parameters (kvargs) ?
# Well, you can have it in bash too!!
$ function myfunc() { local $*; echo "foo=$foo, bar=$bar"; }
$ myfunc bar=world foo=hello
foo=hello, bar=world
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active April 27, 2024 18:27
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@balupton
balupton / README.md
Last active April 29, 2019 11:57
DocPad: Use DocPad, GitHub & Prose as a Wiki

Use DocPad, GitHub and Prose as a Wiki

This guide will walk you through how you can use a GitHub repository to house your wiki content, have DocPad render it, and automatically update on changes. It's also really nice as we get to benefit from the github project workflow for our wiki, that is issues, pull requests, etc.

We use this workflow heavily by linking the DocPad Website and the DocPad Documentation repositories allowing us to have users edit and submit pull requests for improvements to our documentation, and once merged, the website regenerates automatically.

1. Create a new repository for your Wiki Content

@idettman
idettman / add-to-existing-namespaces.js
Last active February 26, 2024 00:57
JavaScript: JSDoc Advanced Tips
/* https://leahayes.wordpress.com/2011/08/28/documenting-javascript-with-jsdoc3/
Namespaces can still be documented when a more abstract mechanism is used. @lends allows members to be added to an existing namespace:
*/
/**
* Root namespace
* @namespace root
*/
$namespace('root', /** @lends root **/ {
/**
@mrharel
mrharel / proxyTrack.js
Created December 28, 2018 14:24
Using Proxy to Track Javascript Class
const callerMap = {};
function getCaller(error) {
if (error && error.stack) {
const lines = error.stack.split('\n');
if (lines.length > 2) {
let match = lines[2].match(/at ([a-zA-Z\-_$.]+) (.*)/);
if (match) {
return {
name: match[1].replace(/^Proxy\./, ''),