Skip to content

Instantly share code, notes, and snippets.

View patrickhulce's full-sized avatar
😎
Live, eat, breathe JS

Patrick Hulce patrickhulce

😎
Live, eat, breathe JS
View GitHub Profile
@patrickhulce
patrickhulce / go.js
Created July 28, 2017 00:44
Remote DevTools expensive layout
const fs = require('fs')
const CDP = require('chrome-remote-interface')
let traceStr = ''
let allEvts = [];
function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
<html>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<body>
Just try and figure out my TTCI (hint: it should be NEVER)<br>
This is a test to ensure we properly handle PerformanceObserver lifecycle, see
<a href="https://crbug.com/742530">https://crbug.com/742530</a>
<script>
/**
* Stalls the main thread for timeInMs
*/
@patrickhulce
patrickhulce / layout-instability.html
Created May 9, 2017 16:53
Simulated ads loading above article content
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html, body, h1 {
margin: 0;
font-size: 150%;
}
.elem {
@patrickhulce
patrickhulce / download_images.js
Last active May 8, 2017 05:38
Gather GMail Images
(alreadySeen => {
function downloadURI(uri) {
console.log('trying to download')
var link = document.createElement("a");
link.download = name;
link.href = uri;
link.click();
return new Promise(resolve => setTimeout(resolve, 2000 + Math.round(Math.random() * 1000)))
}
@patrickhulce
patrickhulce / vscode.prefs
Created March 26, 2017 03:39
Preferences for VSCode
{
"vsicons.presets.hideFolders": true,
"workbench.iconTheme": "vscode-icons",
"window.zoomLevel": 1,
"editor.tabSize": 2,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
@patrickhulce
patrickhulce / DefaultKeyBinding.dict
Created March 24, 2017 18:01
Place in ~/Library/KeyBindings/ folder on macOS Sierra
{
"\UF729" = moveToBeginningOfLine:;
"\UF72B" = moveToEndOfLine:;
"$\UF729" = moveToBeginningOfLineAndModifySelection:;
"$\UF72B" = moveToEndOfLineAndModifySelection:;
}
@patrickhulce
patrickhulce / audio_analyzer.js
Created November 22, 2016 01:20
JsAudioVisualization
// TAKEN FROM https://icanbeyourlighthouse.firebaseapp.com/
(function() {
'use strict';
class Loader {
constructor(url=null) {
this.url = url;
}
@patrickhulce
patrickhulce / dcraw.c
Created November 12, 2016 22:56
dcraw.c
/*
dcraw.c -- Dave Coffin's raw photo decoder
Copyright 1997-2016 by Dave Coffin, dcoffin a cybercom o net
This is a command-line ANSI C program to convert raw photos from
any digital camera on any computer running any operating system.
No license is required to download and use dcraw.c. However,
to lawfully redistribute dcraw, you must either (a) offer, at
no extra charge, full source code* for all executable files
@patrickhulce
patrickhulce / docker_cleanup.sh
Created October 30, 2016 16:09
Docker Cleanup
docker rmi $(docker images | grep "^<none>" | awk '{print $3}') # Remove all untagged images
docker rm $(docker ps -a | grep -E '^[a-f0-9]+\s+[a-f0-9]+\s' | awk '{print $1}') # Remove all containers running untagged images
@patrickhulce
patrickhulce / killall-ssh.sh
Created July 15, 2016 17:55
Kill all open SSH mux sessions
#!/bin/sh
ps aux | grep ssh[:] | awk {'print $2'} | xargs kill -9