Skip to content

Instantly share code, notes, and snippets.

View jackbrown's full-sized avatar

Jack Brown jackbrown

  • Sydney, Australia
View GitHub Profile
{"typeId":"CPU","uid":"3","title":"bschulze-bb-test","head":{"functionName":"(root)","url":"","lineNumber":0,"columnNumber":0,"bailoutReason":"","id":1,"scriptId":0,"hitCount":0,"children":[{"functionName":"runLoop","url":"/Users/bschulze/Projects/tesseract-runtime/packages/common/out/executor/worker/looper.js","lineNumber":17,"columnNumber":18,"bailoutReason":"","id":2,"scriptId":92,"hitCount":0,"children":[{"functionName":"execute","url":"/Users/bschulze/Projects/tesseract-runtime/packages/common/out/executor/worker/runner.js","lineNumber":44,"columnNumber":18,"bailoutReason":"","id":3,"scriptId":95,"hitCount":0,"children":[{"functionName":"exports.default","url":"/Users/bschulze/Projects/tesseract-runtime/packages/common/out/utils/make-trace.js","lineNumber":3,"columnNumber":19,"bailoutReason":"","id":4,"scriptId":1253,"hitCount":0,"children":[{"functionName":"WrappedPromise","url":"/Users/bschulze/Projects/tesseract-runtime/packages/common/node_modules/async-listener/es6-wrapped-promise.js","lineNumber":7
@jackbrown
jackbrown / index.js
Created October 10, 2019 05:39
custom error implementation code dump
const log = {
safeError: (...args) => console.log(...args)
};
function ResourceError({ name, message, component }, errorOverride) {
this.name = name;
this.message = message;
const temp = new Error();
@jackbrown
jackbrown / pinger.js
Created March 23, 2017 22:45
wifi battering ram
'use strict';
const http = require('http');
let count = 0;
setInterval(() => {
http.get({
host: 'neverssl.com'
@jackbrown
jackbrown / webstorm react component template.js
Last active September 15, 2016 08:37
ReactJS component file template for Webstorm
import React, {Component, PropTypes} from 'react';
export default class ${NAME} extends Component {
static propTypes = {};
constructor() {
super();
this.state = {};
}
@jackbrown
jackbrown / SassMeister-input.scss
Created June 23, 2015 00:06
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
.feed {
a {
&:before {
color:green;
@jackbrown
jackbrown / SassMeister-input.scss
Last active August 29, 2015 14:23
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// current
.feed {
a {
&:before {
color:green;
@jackbrown
jackbrown / index
Created August 21, 2014 01:14
HTML5 Placeholders for Internet Explorer without using jQuery
<!doctype html>
<html>
<head>
<title>Placeholders for IE&lt;10</title>
<style>
div.row {
clear: both;
float: left;
}
@jackbrown
jackbrown / gist:327c519e657a1ff24f8b
Created June 5, 2014 06:26
Regular expression for finding a regular expression in a file
/(?!\/\/)(\/)(?!.*?(com|net|com\.au|co\.uk))(.*?){1,}(\/i?g?m?y?)/g
Example: http://regexr.com/38uu8
TODO: get it working with regular expressions that contain \/
TODO: flags should be allowed in any order or combination
@jackbrown
jackbrown / Count number of images in a directory
Last active August 29, 2015 14:01
Command for counting the number of images in a directory
Get a list of all images in a directory and its child directories
find . -type f -name *.gif -o -name *.jpg -o -name *.bmp -o -name *.jpeg -o -name *.png
Get a count of all images in a directory and its child directories
find . -type f -name *.gif -o -name *.jpg -o -name *.bmp -o -name *.jpeg -o -name *.png | wc -l
@jackbrown
jackbrown / loggy
Created May 12, 2014 04:20
A simple web console wrapper
/**
* A simple wrapper for the window.console object
*
* TODO: allow string substitutions: https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions
*/
var loggy = (function () {
var debug = true;
this.info = function(msg){