Skip to content

Instantly share code, notes, and snippets.

View draeton's full-sized avatar

Matthew Kimball-Cobbs draeton

View GitHub Profile
:instabug-reactnative:generateDebugRFile
:instabug-reactnative:generateDebugSources
/Users/matthewcobbs/projects/2019/1212_tvi_what2watch_client/node_modules/instabug-reactnative/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java:2051: error: cannot find symbol
Instabug.setViewsAsPrivate(arrayOfViews);
^
symbol: method setViewsAsPrivate(View[])
location: class Instabug
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
@draeton
draeton / aliases.sh
Created November 28, 2018 15:58
git aliases
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --date=relative"
f=(n,i=(function*(a=0,b=1,c){while(true){c=b+a;a=b;b=c;yield c;}})())=>Array(n).fill().map(()=>i.next().value)
@draeton
draeton / deferred.js
Last active November 5, 2015 19:28
Simple deferred
(() => {
'use strict';
function Deferred() {
this.promise = new Promise((resolve, reject) => {
this.resolve = resolve;
this.reject = reject;
'use strict';
var config = require('./config');
var noop = function () {};
var console = {};
var methods = 'debug error info log warn dir dirxml table trace assert count markTimeline profile profileEnd time timeEnd timeStamp timeline timelineEnd group groupCollapsed groupEnd clear';
@draeton
draeton / params.js
Created January 15, 2014 20:26
Processing url parameters...
var Parameter = function (name /* , value* */) {
this.name = name;
this.values = [].slice.call(arguments, 1);
};
Parameter.prototype.toString = function () {
return this.values.map(function (value) {
return this.name + '=' + value;
}.bind(this)).join('&');
};
@draeton
draeton / debug-var-set.js
Created October 4, 2013 19:50
Rooting out little intractable, hair-pulling, teeth-clenching bugs caused by unforeseen variable overwrites
(function () {
var module;
Object.defineProperty(window, "module", {
get: function () {
return module;
},
set: function (val) {
debugger;
@draeton
draeton / album.js
Last active October 8, 2015 12:48
Perfect Albums Queue
var Queue = function (list) {
this.list = [].concat(list);
};
Queue.prototype = {
constructor: Queue,
random: function () {
var length = this.list.length;
var index = -1;
@draeton
draeton / name.js
Created August 8, 2012 05:50
Test implementation for ES6 Name module
(function (undefined) {
"use strict";
const MIN_STR_LEN = 0x10;
const MAX_STR_LEN = 0xF0 - MIN_STR_LEN;
const MIN_CHAR_CODE = 0x0;
const MAX_CHAR_CODE = 0xFFFF - MIN_CHAR_CODE;
@draeton
draeton / encoder.js
Created August 4, 2012 20:35
Playing around after an article
// http://coding.smashingmagazine.com/2011/10/19/optimizing-long-lists-of-yesno-values-with-javascript/
var Encoder = (function () {
var Encoder = function (trueValue) {
this.trueValue = trueValue;
};
Encoder.prototype = {
encode: function (list) {