Skip to content

Instantly share code, notes, and snippets.

View davidejones's full-sized avatar
🤷‍♂️
keep our code running while other packages are changing theirs

David Jones davidejones

🤷‍♂️
keep our code running while other packages are changing theirs
View GitHub Profile
@davidejones
davidejones / config.yaml
Created October 26, 2017 16:00
Hugo recursive partial to output navigation
languages:
en:
menu:
main:
- identifier: menu_home
name: "Home"
url: "/home/"
weight: 10
- identifier: menu_about
name: "About"
@davidejones
davidejones / getlinks.py
Created November 14, 2017 18:37
Get all hrefs from a url with python3
@davidejones
davidejones / file.js
Last active March 2, 2018 15:16
eloquentjavascript : chapter 2
// looping a triangle
for(var i=0; i < 8; i++) {
console.log('#'.repeat(i));
}
// fizzbuzz
for(var i=1; i < 101; i++) {
if(i % 3 == 0 && i % 5 == 0) {
console.log(i + ' FizzBuzz');
} else if(i % 3 == 0) {
@davidejones
davidejones / file.js
Last active March 5, 2018 16:08
eloquentjavascript : chapter 3
// minimum
function min(arg1, arg2) {
return (arg1 < arg2) ? arg1 : arg2;
}
console.log(min(0, 10));
console.log(min(0, -10));
// recursion
@davidejones
davidejones / file.js
Last active March 21, 2018 15:41
eloquentjavascript : chapter 4
const range = (start, end, step=1) => {
const data = [];
for(let i=start; i <= end; i=i+step) {
data.push(i);
}
return data;
};
console.log(range(3,6));
console.log(range(1,100,10));
@davidejones
davidejones / file.js
Last active March 29, 2018 15:09
eloquentjavascript : chapter 5
// Flattening
let arrays = [[1, 2, 3], [4, 5], [6]];
const data = arrays.reduce((acc, item) => acc.concat(item));
console.log(data);
// Your own loop
// Everything
// Dominant writing direction
@davidejones
davidejones / handler_fieldstorage.py
Created May 2, 2018 15:24
aws lambda parsing multipart form with python3
from cgi import FieldStorage
from io import BytesIO
def parse_into_field_storage(fp, ctype, clength):
fs = FieldStorage(
fp=fp,
environ={'REQUEST_METHOD': 'POST'},
headers={
'content-type': ctype,
@davidejones
davidejones / main.go
Last active April 24, 2019 15:39
yaml go nested list
package main
import (
"fmt"
"log"
"gopkg.in/yaml.v2"
)
var data = `
@davidejones
davidejones / README.md
Last active May 8, 2025 04:40 — forked from JonnyWong16/share_unshare_libraries.py
Automatically share and unshare libraries for Plex users

Requirements

Have python 3 installed somewhere

Install

Download gist zip file and extract to a directory of your choosing then open terminal / cmd prompt at that directory

For mac and linux

@davidejones
davidejones / codes.txt
Created May 17, 2020 15:03
Invisible Man's THPS4 Codes
Invisible Man
gs2v2 codes that i have made the only code i didnt make was flat and holes. just thought id post them
p.s find the (m) code ureself
Never show balance meters
FEAE3986 BCA99B83
Always show balance meters
FEAE399E BCA99B83