Skip to content

Instantly share code, notes, and snippets.

View Gabrock94's full-sized avatar

Giulio Gabrock94

View GitHub Profile
@hailiang-wang
hailiang-wang / pkl_to_json.py
Created April 20, 2017 02:12
Convert python pickle file to json
#!/usr/local/bin/python3
'''
Convert a pkl file into json file
'''
import sys
import os
import _pickle as pickle
import json
@Rich-Harris
Rich-Harris / service-workers.md
Last active July 10, 2024 17:04
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@stared
stared / software_for_scientists.md
Last active May 9, 2024 13:46
Software for scientists: community-edited list of general-purpose software for scientists.

Software for scientists

Some things takes much less time and stress once you know the right tool. Below, there is a community edited list of software for scientists.

Text editors

in General purpose text/code editors. It may be better to have a good editor for everything, than different ones for different languages, scripts, notes.

@mcatta
mcatta / convert-pass-md5
Created May 8, 2013 14:08
Android/Java convert String to MD5
public static String convertPassMd5(String pass) {
String password = null;
MessageDigest mdEnc;
try {
mdEnc = MessageDigest.getInstance("MD5");
mdEnc.update(pass.getBytes(), 0, pass.length());
pass = new BigInteger(1, mdEnc.digest()).toString(16);
while (pass.length() < 32) {
pass = "0" + pass;
}
/*
* ------------------------------------------------------------
* "THE BEERWARE LICENSE" (Revision 42):
* <author> wrote this code. As long as you retain this
* notice, you can do whatever you want with this stuff. If we
* meet someday, and you think this stuff is worth it, you can
* buy me a beer in return.
* ------------------------------------------------------------
*/