Skip to content

Instantly share code, notes, and snippets.

View andrewvmail's full-sized avatar

momoterraw andrewvmail

View GitHub Profile
@justjanne
justjanne / Price Breakdown.md
Last active April 11, 2024 22:21 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@kbussell
kbussell / ctrlTap.lua
Last active February 13, 2021 17:46
Send escape key if the ctrl key is tapped. (Used along side remapping my Caps Lock key to ctrl) Thanks to @asmagill 's examples for a starting point.
local alert = require("hs.alert")
local timer = require("hs.timer")
local eventtap = require("hs.eventtap")
local events = eventtap.event.types
local module = {}
-- timeout for ctrol key
module.timeFrame = .25
@wavezhang
wavezhang / java_download.sh
Last active April 29, 2024 14:42
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@hborders
hborders / decimalize_git_hash.bash
Last active January 7, 2023 13:56
Print the given git hash + a prepended "1" in decimal form
#!/bin/bash -euo pipefail
if [ ${#} -eq 0 ]
then
# read from STDIN
MAYBE_GIT_HASH=$( cat )
else
MAYBE_GIT_HASH="${1}"
fi
@ziadoz
ziadoz / fix-osx-wifi-battery-drain.md
Last active March 25, 2024 13:42
Fix OSX battery draining on sleep due to wifi activity

Fix OSX battery draining on sleep due to wifi activity

Install SleepWatcher using Homebrew:

sudo chown -R $(whoami) /usr/local
brew update
brew install sleepwatcher

Start the SleepWatcher service:

@icebob
icebob / merge.js
Created July 29, 2016 08:19
Merge GraphQL schemas & resolvers in modules
let moduleQueries = [];
let moduleTypeDefinitions = [];
let moduleMutations = [];
let moduleResolvers = [];
let files = config.getGlobbedFiles(path.join(__dirname, "**", "*schema.js"));
// Load schema files
files.forEach((file) => {
let moduleSchema = require(path.resolve(file));
@andymatuschak
andymatuschak / States-v3.md
Last active May 1, 2024 12:32
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

@gdeglin
gdeglin / reasons.md
Last active May 26, 2023 11:55
Reasons an FCM notification can be delayed

Reason 1: Force Stopped

When an app is in a "Force Stopped" state most events including FCM/GCM messages for push notifications will not be received.

An app can be placed in this state in the following ways.

  • From Settings > Apps, "Force Stop" is pressed.
  • Long pressing the back button on some devices.
  • Using a 3rd party task killer like Greenify.
  • App is closed on a Huawei or Xiaomi device due their custom Android tweaks.
@tomysmile
tomysmile / 01-ubuntu-16.04-setup.md
Last active January 28, 2023 21:56
Ubuntu 16.04 Setup in Digital Ocean

Initial Server Setup with Ubuntu 16.04

Update Packages

$ sudo apt-get update

Add Swap

@tanyuan
tanyuan / smart-caps-lock.md
Last active April 30, 2024 00:49
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.