Skip to content

Instantly share code, notes, and snippets.

View jpluimers's full-sized avatar

Jeroen Wiert Pluimers jpluimers

  • wiert.me
  • Amsterdam, The Netherlands
View GitHub Profile
@jpluimers
jpluimers / grab-tco.sh
Created November 20, 2022 15:33 — forked from weiglemc/grab-tco.sh
Command-line to grab t.co URLs from Twitter archive
awk -F '\"' '/\"url\" :/ {print $4}' tweets.js
#!/usr/bin/env python3
import os
import json
with open('tweets.js') as f:
tweets_str = f.read()
# assume the prefix is universally the same ('window.YTD.tweets.part0 = ')
tweets_json = json.loads(tweets_str[26:])
@jpluimers
jpluimers / ChromeTimestamp.java
Created October 28, 2022 07:01 — forked from mariuswatz/ChromeTimestamp.java
Convert Chrome (webkit) timestamp to Unix timestamp
// Marius Watz - http://workshop.evolutionzone.com
//
// Convert webkit timestamps to the UNIX timestamps used in Java.
// Written to deal with timestamps from the Chrome browser history
// database (stored as SQLite)
import java.util.*;
import java.text.SimpleDateFormat;
SimpleDateFormat df=new SimpleDateFormat("YYYY MMM dd HH:mm");
@jpluimers
jpluimers / bookmarklet.js
Created October 3, 2022 10:16 — forked from elidupuis/bookmarklet.js
How to create a bookmarklet with an external js file.
// use this code as your href attribute on your 'Install this bookmarklet' anchor tag.
// borrowed from http://net.tutsplus.com/tutorials/javascript-ajax/create-bookmarklets-the-right-way/
javascript:(function(){var jsCode = document.createElement('script');jsCode.setAttribute('src', 'http://example.com/path/to/file.js');document.body.appendChild(jsCode);}());
@jpluimers
jpluimers / convert-all-youtube-urls-to-nocookie-bookmarklet.js
Created October 3, 2022 09:55 — forked from gvenk/convert-all-youtube-urls-to-nocookie-bookmarklet.js
Convert all youtube urls on a webpage to youtube-nocookie.com urls
javascript:void%20function(){const%20a=document.querySelectorAll(%22a%22);a.forEach(a=%3E{if(-1!==a.href.indexOf(%22youtube.com%22)){const%20b=new%20URL(a.href).searchParams,c=b.get(%22v%22);c%26%26(a.href=%22https://www.youtube-nocookie.com/embed/%22+c)}else-1!==a.href.indexOf(%22youtu.be%22)%26%26(a.href=a.href.replace(%22//youtu.be/%22,%22//www.youtube-nocookie.com/embed/%22))});const%20b=document.querySelectorAll(%22iframe%22);b.forEach(a=%3E{-1===a.src.indexOf(%22//www.youtube.com%22)%3F-1!==a.src.indexOf(%22//youtube.com%22)%26%26(a.src=a.src.replace(%22//youtube.com/%22,%22//www.youtube-nocookie.com/%22)):a.src=a.src.replace(%22//www.youtube.com/%22,%22//www.youtube-nocookie.com/%22)})}();
@jpluimers
jpluimers / Youtube2NoCookie-bookmarklet.js
Created October 3, 2022 09:55 — forked from gvenk/Youtube2NoCookie-bookmarklet.js
Asks users for a youtube url and open it on youtube-nocookie.co
javascript:void%20function(){const%20a=window.prompt(%22Welke%20youtube%20video%20wil%20je%20bekijken%3F%22);if(a){const%20b=new%20URL(a).searchParams,c=b.get(%22v%22);if(c){window.open(%22https://www.youtube-nocookie.com/embed/%22+c)}else{const%20b=a.replace(%22https://youtu.be/%22,%22https://www.youtube-nocookie.com/embed/%22);b!==a%26%26window.open(b)}}}();
@jpluimers
jpluimers / qr-code-bookmarklet.js
Created August 20, 2022 11:23 — forked from andyferra/qr-code-bookmarklet.js
Just a little bookmarklet that will open a new window with a QR code for the current page's URL
javascript:(function(){ window.open( 'http://chart.apis.google.com/chart?cht=qr&chs=512x512&chl=' + document.location.href,'qrcodepopup','width=700,height=700') })();
@jpluimers
jpluimers / explanation.md
Created June 16, 2022 10:18 — forked from masak/explanation.md
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@jpluimers
jpluimers / vm-rename.sh
Last active December 15, 2022 18:08 — forked from Gremgoll/vm-rename
Script to rename a virtual machine in ESXi 6
#!/bin/sh
#
# shell script to rename a virtual machine in ESXi
#set -x
if [ $# -ne 4 ]; then
echo "Usage: $0 VOLNAME DIRNAME OLDNAME NEWNAME
where VOLNAME is the volume name, e.g. datastore1,
DIRNAME is the the name of the directory of the virtual machine,
@jpluimers
jpluimers / gist:d453c707276298f47729d96a608f8b75
Created March 30, 2022 11:29 — forked from spudbean/gist:1558257
Look of disapproval and other emoticons
ಠ_ಠ
( ͡° ͜ʖ ͡°)
¯\_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
http://www.fileformat.info/convert/text/upside-down.htm
WRTTN http://wrttn.me/30dbfd/
Unicode Emoticons