Skip to content

Instantly share code, notes, and snippets.

Avatar

Zearin Zearin

  • Virginia, U.S.A.
View GitHub Profile
@mrharel
mrharel / proxyTrack.js
Created December 28, 2018 14:24
Using Proxy to Track Javascript Class
View proxyTrack.js
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\./, ''),
@balupton
balupton / README.md
Last active April 29, 2019 11:57
DocPad: Use DocPad, GitHub & Prose as a Wiki
View README.md

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

@brandonb927
brandonb927 / osx-for-hackers.sh
Last active February 24, 2023 20:20
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.
View osx-for-hackers.sh
#!/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
@caruccio
caruccio / bash-named-param
Created April 24, 2012 03:25
Named parameters in bash
View bash-named-param
# 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
@juanpabloaj
juanpabloaj / 256colors.sh
Created January 25, 2012 00:18
256 terminal colors list
View 256colors.sh
# 256 terminal colors
# http://superuser.com/q/285381
for i in {0..255} ; do
printf "\x1b[38;5;${i}mcolour${i}\n"
done
@gre
gre / easing.js
Last active March 16, 2023 10:29
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
View easing.js
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@bartdag
bartdag / Java
Created July 7, 2011 19:18
Java and Python and Py4J
View Java
package p1;
import py4j.GatewayServer;
public class MyApplication {
public static void main(String[] args) {
GatewayServer server = new GatewayServer(null);
// This will start the Py4J server and now, the JVM is ready to receive Python commands.
@pmuellr
pmuellr / gist:1004413
Created June 2, 2011 13:24
BBEdit Language Module for CoffeeScript
View gist:1004413
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
BBEdit Language Module for CoffeeScript
Put this file in
~/Library/Application Support/BBEdit/Language Modules
or equivalent.
Based off of the examples shipped in the BBEdit SDK.
@Zearin
Zearin / icon-naming-spec.xml
Created May 31, 2011 15:29
Freedesktop.org’s icon naming specification, represented as XML. Intended as a convenience to XML devs.
View icon-naming-spec.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
@source
http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
@author
Zearin <zearin@gonk.net>
@license
I haven’t chosen a license yet. In the meantime, feel free to reuse this
View magic-properties.js
/**
* This library defines magic properties and methods
* for objects. Generic hooks are: __get__, __set__,
* __delete__, __count__, __call__, __construct__,
* __noSuchProperty__ and __noSuchMethod__.
*
* Used features: Harmony (ES6) proxies.
*
* Tested in FF4 beta.
*