Skip to content

Instantly share code, notes, and snippets.

View confluencepoint's full-sized avatar
:octocat:
Focusing

confluencepoint confluencepoint

:octocat:
Focusing
View GitHub Profile
@confluencepoint
confluencepoint / hammerspoon_sleep_script.lua
Created November 11, 2019 05:27 — forked from boringrgb/hammerspoon_sleep_script.lua
This tiny script goes into your Hammerspoon configuration and it hooks on the lid open/close event
function sleepWatch(eventType)
local action = "unknown"
if (eventType == hs.caffeinate.watcher.systemWillSleep) then
hs.alert.show("Going to sleep!")
host = hs.host.localizedName()
action = "sleep"
elseif (eventType == hs.caffeinate.watcher.systemDidWake) then
hs.alert.show("Waking up!")
action = "awake"
end

How to setup Python on macOS

Recently, I turned into a big fan of pyenv and poetry for managing my Python installation on macOS. The basic steps are easy but can get tricky.

Setup pyenv and Python

Theses steps assume you have installed Homebrew. But of course you can also install pyenv with its own installer.

brew install pyenv
@confluencepoint
confluencepoint / colors.sh
Created September 22, 2019 12:17 — forked from kennethreitz/colors.sh
Bash foreground ANSI terminal colors script.
#!/usr/bin/env bash
function bake_fg_color {
BLACK="\033[0;30m"
BLACK_BOLD="\033[1;30m"
WHITE="\033[0;37m"
WHITE_BOLD="\033[1;37m"
RED="\033[0;31m"
RED_BOLD="\033[1;31m"
GREEN="\033[0;32m"
@confluencepoint
confluencepoint / karabiner_merge.sh
Created June 16, 2019 04:38 — forked from narze/karabiner_merge.sh
Merge karabiner.json with complex modification rules
#!/usr/bin/env bash
# Requirements : goku, jq
# 1. Make sure goku runs
goku
# 2. Make temp json file
cp ~/.config/karabiner/karabiner.json ~/.config/karabiner/karabiner.tmp.json
@confluencepoint
confluencepoint / chrome_tabs.osa
Created March 19, 2019 04:39 — forked from samyk/chrome_tabs.osa
applescript to show all url+titles of Chrome tabs along with front window+tab url+title
# shows all url+titles of Chrome along with front window+tab url+title
set titleString to ""
tell application "Google Chrome"
set window_list to every window # get the windows
repeat with the_window in window_list # for every window
set tab_list to every tab in the_window # get the tabs
repeat with the_tab in tab_list # for every tab
@confluencepoint
confluencepoint / gist:544708dcc0b7d5cd646f0dda173a52af
Created March 19, 2019 04:39 — forked from mayoff/gist:1138816
AppleScript to make Google Chrome open/reload a URL
(* To the extent possible under law, Rob Mayoff has waived all copyright and related or neighboring rights to “AppleScript to make Google Chrome open/reload a URL”. This work is published from: United States. https://creativecommons.org/publicdomain/zero/1.0/ *)
tell application "Google Chrome"
activate
set theUrl to "http://tycho.usno.navy.mil/cgi-bin/timer.pl"
if (count every window) = 0 then
make new window
end if
set found to false
@confluencepoint
confluencepoint / init.lua
Created February 21, 2019 07:00 — forked from tobetchi/init.lua
Remap ctrl-h to delete for Skype.app with hammerspoon config
local function enableHotkeys(hotkeys)
for k, v in pairs(hotkeys) do
v:enable()
end
end
local function disableHotkeys(hotkeys)
for k, v in pairs(hotkeys) do
v:disable()
end
@confluencepoint
confluencepoint / file.js
Created February 4, 2019 19:09 — forked from lewisnyman/lunch.js
Random lunch status textexpander snippet
const emoji = [
  "🍔",
  "🍕",
  "🌭",
  "🥪",
  "🥗",
  "🌯",
  "🍱",
  "🍝",
  "🍜"
// by Etienne JACOB
// motion blur template by beesandbombs
// needs opensimplexnoise code in another tab
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
@confluencepoint
confluencepoint / config.md
Created September 7, 2018 18:56 — forked from 0xDE57/config.md
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".