Skip to content

Instantly share code, notes, and snippets.

Avatar

Ole Jørgen Brønner olejorgenb

View GitHub Profile
@bmaupin
bmaupin / android-llama-alternatives.md
Last active March 15, 2023 03:43
Alternatives to Llama for Android
View android-llama-alternatives.md

Goal

Find a replacement for Llama (R.I.P. 😢)

Conclusion

🦙 Keep using Llama! 🦙

  • Llama still works and no other application seems to match Llama in terms of ease of use and cell-tower location (Llama's killer feature)
  • Cell-tower location UX seems to be unmatched by the alternatives (training new locations, ignoring towers, seeing location events)
@hurryabit
hurryabit / merge-speedscope-json.js
Last active March 14, 2023 17:06
Merge multiple profiles in Speedscope's JSON format into one file
View merge-speedscope-json.js
#!/usr/bin/env node
"use strict";
const fs = require("fs");
const SPEEDSCOPE_JSON_SCHEMA = "https://www.speedscope.app/file-format-schema.json";
const [node, prog, ...options] = process.argv;
if (options[options.length - 2] !== "-o") {
@mkows
mkows / server-cors.py
Created July 31, 2019 15:16
Allow CORS with python Simple HTTP Server – for Python 3
View server-cors.py
'''
Based on https://gist.github.com/enjalot/2904124 (in Python 2) -> quick-migrated to Python 3
Usage: python server-cors
'''
import http.server as httpserver
class CORSHTTPRequestHandler(httpserver.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
@johnhw
johnhw / umap_sparse.py
Last active April 3, 2023 21:25
1 million prime UMAP layout
View umap_sparse.py
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@ddevault
ddevault / Makefile
Last active May 5, 2023 16:26
Tiny Wayland compositor
View Makefile
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
@BenoitAverty
BenoitAverty / userChrome.css
Last active March 11, 2023 17:12
Hide tab bar on firefox 89 when there is only one tab
View userChrome.css
/*
How To:
1. Find your firefox profile folder : https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data
2. create a "chrome" folder if it doesn't exist
3. Paste content of this gist in a "userChrome.css" file
4. Go to about:config and set toolkit.legacyUserProfileCustomizations.stylesheets to true
5. set browser.tabs.tabmanager.enabled to false (to hide the "tab search" button)
5. Restart Firefox
Don't hesitate to say if there are bugs, I only tested this for my workflow : I don't use tabs
@garoto
garoto / mpvhistory.lua
Last active February 14, 2023 21:28
Simple media logger Lua script for mpv
View mpvhistory.lua
-- Not my code: originally from https://redd.it/3t6s7k (author deleted; failed to ask for permission).
-- Only tested on Windows. Date is set to dd/mmm/yy and time to machine-wide format.
-- Save as "mpvhistory.lua" in your mpv scripts dir. Log will be saved to mpv default config directory.
-- Make sure to leave a comment if you make any improvements/changes to the script!
local HISTFILE = (os.getenv('APPDATA') or os.getenv('HOME')..'/.config')..'/mpv/mpvhistory.log';
mp.register_event('file-loaded', function()
local title, logfile;
@aherrmann
aherrmann / pnix-shell.sh
Last active August 23, 2020 20:31
Fully persistent Nix shell
View pnix-shell.sh
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@bycoffe
bycoffe / README.md
Last active March 19, 2023 09:45
Split an SVG path into pieces
View README.md
@martijnvermaat
martijnvermaat / nixos.md
Last active May 5, 2023 02:46
Installation of NixOS with encrypted root
View nixos.md