Skip to content

Instantly share code, notes, and snippets.

View marcus-crane's full-sized avatar
💭
Online and logged on

Marcus Crane marcus-crane

💭
Online and logged on
View GitHub Profile
@jwbee
jwbee / jq.md
Last active June 2, 2025 14:15
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is

Draziw.Button.Mines
ag.video_solutions.wedotv
ahf.dummynation
ai.socialapps.speakmaster
air.com.beachbumgammon
air.com.freshplanet.games.SongPop2
air.com.gamesys.mobile.slots.jpj
air.com.goodgamestudios.empirefourkingdoms
air.com.kitchenscramble.goo
air.com.lalaplay.rummy45

Crippling Facebook

Facebook works with advertisers to target you. These instructions are one of the many ways to begin crippling that relationship. When AI targeting is crippled, your psychosecurity improves :)

  1. On your desktop machine, goto https://accountscenter.facebook.com/ads/audience_based_advertising
  2. Maximize the browser window
  3. Press F12 and click on the Console tab
  4. Select the code below, copy it, paste it upon the Console line (The area next to the > character in the Console window), and press enter:
import json
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from datetime import datetime, timedelta, timezone
import argparse
# This script can be useful when filling your freelancer timesheets,
# it generates a heatmap image with the messages/hour/day.
#
@davidborzek
davidborzek / spotify-ws.js
Created August 6, 2021 12:48
Access the spotify websocket api for real time updates about playback etc. Only works with an offical access token, third-party ones don't work.
import axios from 'axios';
import WebSocket from 'ws';
/*
Use a spotify acces token from an offical source like open.spotify.com. You can obtain it by using the network inspector in your browser.
Third-party access token obtained via OAuth2 will not work because of an api limitation by spotify.
*/
const ACCESS_TOKEN = "";
const createWebSocketUrl = (accessToken) => `wss://dealer.spotify.com/?access_token=${accessToken}`;
@kepano
kepano / obsidian-web-clipper.js
Last active May 29, 2025 16:45
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@jamesmacfie
jamesmacfie / README.md
Created October 22, 2019 02:53
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@pgaskin
pgaskin / kobodevices.yaml
Last active July 17, 2023 16:10
Kobo device information based on 4.18.13737
# 1. create top-level classes from Device::codeName(QString)
# 2. split into legacy and current based on if class in Device::getDeviceClassString() is based on Device::codeName
# 3. add legacy families under top-level classes, codename=classname and Name is from Device::getDeviceClassString()
# 4. add legacy device ids under families from Device::codeName(QString)
# 5. skip current families for now, add device ids from Device::codeName(QString)
# 6. add device names from known values to those devices
# 7. split current devices into families based on Device::codeName(bool), remaining ones have a matching classname
# 8. add family names from Device::getDeviceClassString()
#
# 9. add full values for most specific (codename, then classname) thingies from Image::sizeForType(Device)
@ThYpHo0n
ThYpHo0n / .zshrc
Last active August 5, 2024 01:37
WSL(2) bash profile helpers
# WSL?
if [[ "$(< /proc/sys/kernel/osrelease)" == *microsoft* ]]; then
export $(dbus-launch)
export LIBGL_ALWAYS_INDIRECT=1
export WSL_VERSION=$(wsl.exe -l -v | grep -a '[*]' | sed 's/[^0-9]*//g')
export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2)
export DISPLAY=$WSL_HOST:0
# pip path if using --user
export PATH=$PATH:$HOME/.local/bin
# SSH