Skip to content

Instantly share code, notes, and snippets.

thewheat / bookmarklet.js
Created Jul 31, 2020
Epic book bookmarklet to start audio book from page 1. Converted to a bookmarklet via
View bookmarklet.js
thewheat / annotatorjs.php
Last active Jun 6, 2020
Demo file of that allows saving of annotations in a simple text file
View annotatorjs.php
define("ANNOTATIONS_FILE", "annotations.json");
$annotations = getAnnotations();
if (!$_GET || !$_GET['action']){
else if ($_GET['action'] == "search") {
$uri = $_GET['uri'];
thewheat /
Last active Oct 24, 2019
Commands for screen/tmux


  • Ctrl + a, c: create new screen
  • Ctrl + a, a: switch to previous screen
  • Ctrl + a, ": list all screens
  • Ctrl + a, NumberX : switch to screen #NumberX
  • screen -ls: list all sessions
  • screen -rad ID: reattach



View youtube-dl.md5
# Quick start for youtube-dl
## Default usage
youtube-dl URL
## Download certain resolution
youtube-dl -f "best[height<=480]" URL
## Download certain extension
thewheat / brunei_postcodes.csv
Last active Sep 2, 2019
Brunei Postcodes extracted from There are some without postcodes due to the server not returning any data. If you need to know which Mukim/ Kampong you're located in could be useful
View brunei_postcodes.csv
Number District Mukim Kampong Code
95 Brunei-Muara Daerah Brunei Dan Muara Peti Surat 01 hingga 500 BS8670
97 Brunei-Muara Daerah Brunei Dan Muara Peti Surat 1001 hingga 1500 BS8672
98 Brunei-Muara Daerah Brunei Dan Muara Peti Surat 1501 hingga 2000 BS8673
99 Brunei-Muara Daerah Brunei Dan Muara Peti Surat 2001 hingga 2500 BS8674
100 Brunei-Muara Daerah Brunei Dan Muara Peti Surat 2501 BS8675
96 Brunei-Muara Daerah Brunei Dan Muara Peti Surat 501 hingga 1000 BS8671
107 Brunei-Muara Daerah Brunei Dan Muara Peti Surat Persendirian (Pejabat Pos Anggerek Desa) BB3713
102 Brunei-Muara Daerah Brunei Dan Muara Peti Surat Persendirian (Pejabat Pos Gadong) BE3978
108 Brunei-Muara Daerah Brunei Dan Muara Peti Surat Persendirian (Pejabat Pos Limau Manis) BH2323
thewheat /
Last active Mar 8, 2020
Document typical ffmpeg commands I use

Extract only video from file

ffmpeg -i -c:v copy -an

Extract only audio from file

ffmpeg -i -c:a copy -vn input_audio.aac
thewheat / Intercom Encrypted
Last active Mar 10, 2020
Sample code to enable Intercom Encrypted Mode
View Intercom Encrypted
View intercom_with_leadpages
window.intercomSettings = {
app_id: APP_ID
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='' + APP_ID;var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
thewheat / intercom_with_shopify.js
Last active Aug 29, 2018
Integrate Intercom into Shopify via manual code. Supports both visitors and logged in users
View intercom_with_shopify.js
// Add this to your theme layout code after the footer
{% if customer %}
window.intercomSettings = {
app_id: APP_ID,
name: "{{}}",
email: "{{}}",
thewheat /
Last active Aug 22, 2019
Attributes for Intercom's client side Javascript integration used when installing the messenger

Javascript Installation Attributes

  • Intercom can be initialised with various ways For visitors
window.intercomSettings = { 
  app_id: YOUR_APP_ID

For Logged in users

You can’t perform that action at this time.