Skip to content

Instantly share code, notes, and snippets.

View trusktr's full-sized avatar
📜
writing code

Joe Pea trusktr

📜
writing code
View GitHub Profile
@trusktr
trusktr / multiple.2.js
Last active May 25, 2020 06:48
Multiple Inheritance Implementation #2 - Copying classes and combining them into a single prototype chain. Fails miserably due to static `super` and use of `eval`, among other problems.
function multiple(...classes) {
// If more than one class extends from a native class, we may need to throw
// an error, since we can't mix native prototypes; We won't throw if the
// native prototypes of one class or in the same chain as the native
// prototypes in the others. For example, if one class extends from Array
// and another from Event, we'll throw an error because we can't put the
// Array prototype before the Event prototype or vice versa
// (`Array.prototype` and `Event.prototype` are `{enumerable:false,
// writable:false, configurable:false}`, so we can't change the __proto__ of
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.infamous=e():t.infamous=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){n(1),t.exports=n(292)},function(t,e,n){(function(t){"use strict";function e(t,e,n){t[e]||Object[r](t,e,{writable:!0,configurable:!0,value:n})}if(n(2),n(287),n(289),t._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");t._babelPolyfill=!0;var r="defineProperty";e(String.prototype,"padLeft","".padStart),e(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(funct
@trusktr
trusktr / images.md
Last active September 24, 2016 16:23
Images

this is a short paragraph


Testing powered by:

BrowserStack

/*
* Test 1 - for..in with hasOwnProperty check.
*/
var counter = 0
var i
var p
var start = performance.now()
for (i=0; i<1000; i+=1) {
for (p in window) {
if (window.hasOwnProperty(p)) {}
@trusktr
trusktr / MenuBackIcon.qml
Created October 26, 2015 22:29 — forked from cyberbobs/MenuBackIcon.qml
Animated hamburger-back icon in Material Design style done in QML
import QtQuick 2.2
Item {
id: root
width: 24
height: 24
Rectangle {
id: bar1
x: 2
@trusktr
trusktr / assets.md
Last active June 11, 2025 19:05
assets in the comments
@trusktr
trusktr / DefaultKeyBinding.dict
Last active August 5, 2025 07:35
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
set-option -g default-shell /bin/zsh
set -g default-command /bin/zsh
set -g default-terminal "screen-256color"
# Choose your favorite prefix key.
unbind C-b
set -g prefix C-a
bind C-a send-prefix
#?
@trusktr
trusktr / gist:356e4f6f2840827ea9ea
Created June 12, 2014 08:10
Touch emulation shell script for Android.
sleep 10
while [ 1 ]; do
input swipe 700 380 1020 600 1000
input tap 960 540
input swipe 1220 700 900 480 1000
input tap 960 540
input swipe 1220 700 900 480 1000
input tap 960 540
@trusktr
trusktr / .xinitrc
Last active August 29, 2015 14:02
Xorg initrc configuration.
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done