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 / update_s3_meta.sh
Last active October 12, 2023 11:52
Update s3 metadata for an object and preserve existing content meta
#!/bin/bash
BUCKET="my-bucket"
KEY="/foo/bar/baz.xml"
FILENAME=$(basename $KEY)
#
# {
# “ContentType”: “text/xml; charset=utf-8",
# “CacheControl”: “public, must-revalidate, proxy-revalidate, max-age=0",
@davidejones
davidejones / get_files_to_delete.py
Created April 14, 2022 17:06
find files in transifex that aren't in local checked out repo
import argparse
from pprint import pprint
import requests
import pathlib
session = requests.Session()
def get_resources(options):
@davidejones
davidejones / update_metadata.py
Last active April 13, 2022 16:27
Updates s3 metadata have an md5chksum
import argparse
import hashlib
import logging
import tempfile
import boto3
def md5(file_handle, block_size=4096):
"""
@davidejones
davidejones / keybase.md
Created August 26, 2020 08:00
keybase.md

Keybase proof

I hereby claim:

  • I am davidejones on github.
  • I am davidejones (https://keybase.io/davidejones) on keybase.
  • I have a public key ASB7TaUT5tnmGBniXy4NUfPeXwScYoJMjbXKt2GcpVNIJAo

To claim this, I am signing this object:

@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
@davidejones
davidejones / README.md
Last active May 23, 2023 06:27 — 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 / 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 / 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 / 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 / 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));