Skip to content

Instantly share code, notes, and snippets.

View jhnlsn's full-sized avatar

John jhnlsn

View GitHub Profile
@jhnlsn
jhnlsn / clean_node.sh
Last active May 8, 2019 00:46
Clean node_modules folders recursively
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
@jhnlsn
jhnlsn / class.js
Created April 27, 2019 19:02
JS Class
class Zoo {
lion = 'Randy'
#password = 'meat'
}
const bronx = new Zoo()
console.log(bronx); // Zoo { lion: 'Randy' }
@jhnlsn
jhnlsn / main.go
Created March 19, 2019 17:39
Random region selection
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws/endpoints"
)
func main() {
@jhnlsn
jhnlsn / gist:5410328221720a724aef65e34b7e9a10
Last active February 17, 2018 02:05
deep clone doesn't work
const a = [1,2,3,4,5];
const aCloned = [...a];
aCloned.push(7);
console.log(a);
console.log(aCloned);
ref = {big: 'name'};
skills = ["javascript"]
@jhnlsn
jhnlsn / bash
Created February 7, 2018 11:31
➜ docker-healthchecks git:(master) docker run --rm -it -p 8181:8000 jhnlsn/healthchecks:latest
usermod: no changes
Added "SECRET_KEY" (value "AriaZmtcEHPDAu5PSl/iU5lf4M8k/w1v7AoRZW+V9I4=") to settings.py
Added "DEBUG" (value "False") to settings.py
Added "HOST" (value "0.0.0.0") to settings.py
Found 'compress' tags in:
/healthchecks/templates/front/channels.html
/healthchecks/templates/integrations/add_discord.html
/healthchecks/templates/accounts/change_email_done.html
/healthchecks/templates/accounts/set_password.html

Keybase proof

I hereby claim:

  • I am jhnlsn on github.
  • I am jhnlsn (https://keybase.io/jhnlsn) on keybase.
  • I have a public key ASBCrWOFcmh4gB-RjW109pvemBBVVXQXV_aezWmS80DJCAo

To claim this, I am signing this object:

var done = _.after(3, function(){
console.log('all done');
})
$.get('url', function(){
done();
});
$.get('url', function(){
done();
@jhnlsn
jhnlsn / gist:9358088
Last active August 29, 2015 13:57
Things to do to a new Mac

PHP & Apache

sudo curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5
@jhnlsn
jhnlsn / gist:9336561
Last active August 29, 2015 13:56
Bash Cheat Sheet
-r file #Check if file is readable.
-w file #Check if file is writable.
-x file #Check if we have execute access to file.
-f file #Check if file is an ordinary file (not a directory, a device file, etc.)
-s file #Check if file has size greater than 0.
-d file #Check if file is a directory.
-e file #Check if file exists. Is true even if file is a directory.
if [ -f file ] ; then
# File exists
@jhnlsn
jhnlsn / gist:9275918
Created February 28, 2014 17:48
A Modified Logstash init.d script when /etc/init.d/functions does not exist
#! /bin/sh
#
# /etc/rc.d/init.d/logstash
#
# Starts Logstash as a daemon
#
# chkconfig: 2345 20 80
# description: Starts Logstash as a daemon
# pidfile: /var/run/logstash-agent.pid