Skip to content

Instantly share code, notes, and snippets.

@varenc
varenc / camps2014
Last active September 7, 2018 02:28 — forked from tastycode/camps2014
[ [ { title: 'A Camp with No Name (ACWNN)',
description: 'The dead horse is scarce, and we continue to beat it. Come by and sit in the desert in A Camp With No Name, where you will be told that buttered popcorn is a perfectly fantastic snow cone flavor – why would you think otherwise? (Don’t worry – there are “normal” flavors.) Look for us carting around chai or tidying up the playa with our vacuum cleaner.',
Hometown: 'Denver',
URL: 'https://www.facebook.com/pages/A-Camp-with-No-Name/259880375086?ref=hl' },
{ title: 'A Cosmic Carnivale',
description: 'Come and visit a Cosmic Carnival and may your body never miss a beat to the rhythm of this world.',
Hometown: 'Reno',
Contact: '[email protected]' },
{ title: 'A Shack of Sit',
description: 'SIT HAPPENS HERE 24×7. Shady chairs & lounges: refresh, rest, meet Burners. Enjoy iced water, healthy snax, lots of activities & WiFi.',
@varenc
varenc / ngrok-copy
Last active November 5, 2024 13:10 — forked from mlsteele/ngrok-copy
Copy the url of the active ngrok connection to the clipboard. Updated Oct-2019
#!/usr/bin/env bash
# Copy the url of the active ngrok connection to the clipboard. Updated for latest ngrok (Oct 2019)
#
# Usage:
# ngrok-copy # copies e.g. https://3cd67858.ngrok.io to clipboard.
# ngrok-copy -u # copies e.g. http://3cd67858.ngrok.io to clipboard.
#
# Modified from the original script at https://gist.github.com/mlsteele/f57adc1fab5c44656d6d
@varenc
varenc / MediaRemoteEvents.m
Last active April 21, 2022 18:31 — forked from dnicolson/MediaRemoteEvents.m
Use the MediaRemote private framework to get and set the playing state of the Touch Bar based on media change events
// varenc's very simple fork of dnicolson's gist.
//
// changelog: on start immediately output the current MediaRemote state
// todo: might turn this into a command line util for personal workflow automation.
//
// clang -x objective-c -framework Foundation -framework MediaRemote -F /System/Library/PrivateFrameworks MediaRemoteEvents.m -o MediaRemoteEvents.m
// ./MediaRemoteEvents.m
#import <Foundation/Foundation.h>
@varenc
varenc / README.md
Created May 5, 2020 07:01 — forked from klausondrag/README.md
Pinyin support for Language Learning with Netflix Extension
@varenc
varenc / dontforget.sh
Last active July 25, 2020 08:34 — forked from ttscoff/dontforget.bash
Quick reminders from Terminal (bash)
#!/bin/bash
# dontforget
#
# A stupid script for short term reminders in bash
#
# UPDATE: Tweaked to work on macOS catalina in 2020! (no more launchbar.app). Also removed the `say`
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't
/* file: main.c function: get and set capslock state complie: gcc -std=c99 -framework IOKit -framework CoreFoundation -o
* capslock main.c usage: ./capslock [0|1|-1] 0 : capslock off 1 : capslock on -1 : toggle capslock state : print
* current capslock state (0|1) * written and published as free software by Hiroto, 2015-06 */
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/hidsystem/IOHIDLib.h>
#include <IOKit/hidsystem/IOHIDParameter.h>
#include <libgen.h> // basename
#define CAPSLOCK_OFF 0
#define CAPSLOCK_ON 1
@varenc
varenc / DefaultKeyBinding.dict
Created March 11, 2021 00:37 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@varenc
varenc / export.js
Created March 21, 2021 00:29 — forked from loilo/export.js
Browser console support for shellking4
// Copy this whole snippet to your browser console
var dbName = prompt("What's the name of the database to export?")
;(async () => {
try {
var dbExists = await new Promise(resolve => {
var request = window.indexedDB.open(dbName)
request.onupgradeneeded = e => {
e.target.transaction.abort()
@varenc
varenc / system-wide-clipboard.zsh
Last active August 31, 2024 23:38 — forked from welldan97/system-wide-clipboard.zsh
Zsh copy & paste system wide for OS X, like in emacs
## 2020-05-16: Changed `echo` to `printf` so that backslashes are not interpretted by echo
## and so that CUTBUFFER shows up exactly in the pasteboard without modification
pb-kill-line () {
zle kill-line
printf '%s' $CUTBUFFER | pbcopy
}
pb-kill-whole-line () {
zle kill-whole-line
@varenc
varenc / close_notifications_applescript.js
Created June 6, 2021 21:56 — forked from lancethomps/close_notifications_applescript.js
AppleScript to close all notifications on macOS Big Sur
function run(input, parameters) {
const appName = "";
const verbose = true;
const scriptName = "close_notifications_applescript";
const CLEAR_ALL_ACTION = "Clear All";
const CLEAR_ALL_ACTION_TOP = "Clear";
const CLOSE_ACTION = "Close";