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 / 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
@patrickhulce
patrickhulce / siege.sh
Created February 4, 2016 21:13
siege POST
siege -c 20 -d 0 -H "Content-Type: application/x-www-form-urlencoded" -g 'http://localhost:3000/endpoint POST mydata=foo'
siege -c 20 -d 0 -H "Content-Type: application/json" -g 'http://localhost:3000/endpoint POST {"key": "value"}'
@patrickhulce
patrickhulce / entry.js
Last active August 27, 2015 05:59
webpack intro
var webpack = require('webpack');
module.exports = {
entry: {
app: './entry.js'
},
output: {
path: __dirname,
publicPath: '/assets/',
filename: "[name].bundle.js"
@patrickhulce
patrickhulce / ScalaStyle.md
Last active April 25, 2018 10:24
Scala Style Guide