Skip to content

Instantly share code, notes, and snippets.

@gilbertw1
gilbertw1 / mu-index-notify.sh
Last active January 6, 2021 14:32
A simple script that re-indexes emails using mu and sends a notification if new emails are detected.
# puts timestamps into an easily comparable format
extract_timestamp() {
local RAW="$(echo "$1" | cut -c1-31)"
echo "$(date --date="$RAW" '+%Y-%m-%d:%H:%M:%S')"
}
# removes html characters that are interpreted poorly by dunst
format_string() {
echo "$1" | sed 's/>/\&gt;/' | sed 's/</\&lt;/' | sed 's/\$/\\$/'
}
@arbelt
arbelt / init.lua
Created October 2, 2016 20:55
Hammerspoon config to send escape on short ctrl press
ctrl_table = {
sends_escape = true,
last_mods = {}
}
control_key_timer = hs.timer.delayed.new(0.15, function()
ctrl_table["send_escape"] = false
-- log.i("timer fired")
-- control_key_timer:stop()
end
@unsalted
unsalted / sierra-hackintosh-z170-a.md
Last active June 4, 2021 14:03
Sierra 10.12.3 Hackintosh | Asus z170-A, Intel i5 6500, MSI GTX 960 OC, GTX1070(Dormant)

Sierra 10.12.3 Hackintosh

This is my build documentation for an ASUS Z170-A setup with an NVIDIA GTX960 and the Intel i5 6500, most of this came from Storks asus rog maximus build, his audio instructions didn't work for me so it differs substantially there. This build also doesn't have NVRAM. Nearest I can tell everything is running as expected, including all USB and audio ports.

Build

  • Asus Z170-A
  • Intel Core i5-6500
  • Crucial Ballistix Sport LT 32GB (2 x 16GB) DDR4-2400 Memory
  • MSI GeForce GTX 960 4GB Installed in slot 1!
@mrflix
mrflix / OrbitControls.js
Last active November 29, 2021 02:44
Three.OrbitControls for multiple instances on a page.Usage: controls = new THREE.OrbitControls(camera, document, renderer.domElement); Based on: http://threejs.org/examples/js/controls/OrbitControls.js
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author erich666 / http://erichaines.com
* @author mrflix / http://felixniklas.de
*
* released under MIT License (MIT)
*/

I was struggling to compose datomic queries neatly. In the end I googled and found a blogpost which proposed a sane solution.

My motivation was an API endpoint with optional filters. I'd like my query include additional filters based on the args present.

Anyway, here's how my code ended up looking...

And the article: http://grishaev.me/en/datomic-query

@matthewdowney
matthewdowney / hack-captive-portal.bb
Created January 5, 2023 18:39
Script to bypass captive portals from https://miloserdov.org/?p=1088, ported to Babashka and improved
#!/usr/bin/env bb
; =========================================================================== ;
; FILE: hack-captive-portal.bb ;
; USAGE: sudo bb hack-captive-portal.bb ;
; ;
; DESCRIPTION: This script helps to pass through the captive portals in ;
; public Wi-Fi networks. It hijacks IP and MAC from somebody ;
; who is already connected and authorized on captive portal. ;
; Tested in Ubuntu 16.04 with different captive portals in ;
; airports and hotels all over the world. ;
@romainl
romainl / .ctags
Last active June 14, 2023 09:19
My ctags config
--langdef=less
--langmap=less:.less
--regex-less=/^[ \t&]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-less=/^[ \t&]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
--regex-less=/^[ \t]*(@[A-Za-z0-9_-]+):/\1/v,variable,variables/
--regex-less=/\/\/[ \t]*(FIXME|TODO)[ \t]*\:*(.*)/\1/T,Tag,Tags/
--langdef=scss
@karlhorky
karlhorky / pr.md
Last active November 2, 2023 13:44 — forked from piscisaureus/pr.md
Fetch all GitHub pull requests to local tracking branches

NOTE

You may not need local branches for all pull requests in a repo.

To fetch only the ref of a single pull request that you need, use this:

git fetch origin pull/7324/head:pr-7324
git checkout pr-7324
# ...
@stain
stain / .notmuch-config
Last active November 13, 2023 08:17
NotMuch hooks for selectively sorting to inbox, moving archived messages to other folder. offlineimap syncs to /home/USER/mail/company and /home/USER/mail/org1
[database]
path=/home/USER/mail
[user]
name=MyName MySurname
primary_email=me@example.com
other_email=me@example.org