# Navigating the page
map j scrollDown
map <c-e> scrollDown
map k scrollUp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'monitor' | |
class Semaphore | |
def initialize(maxval = nil) | |
maxval = maxval.to_i unless maxval.nil? | |
raise ArgumentError.new("Semaphores must use a positive maximum value or have no maximum!") if maxval and maxval <= 0 | |
@max = maxval || -1 | |
@count = 0 | |
@mon = Monitor.new | |
@dwait = @mon.new_cond | |
@uwait = @mon.new_cond |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/gui | |
(require graphics/graphics) | |
(open-graphics) | |
(define vp (open-viewport "A Picture Language" 500 500)) | |
(define draw (draw-viewport vp)) | |
(define (clear) ((clear-viewport vp))) | |
(define line (draw-line vp)) | |
(define (make-vect x y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AuthHelper | |
def http_login | |
user = 'username' | |
pw = 'password' | |
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw) | |
end | |
end | |
module AuthRequestHelper | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if test -z "$1"; then | |
echo "Usage: $0 <prompt>" | |
exit 1 | |
fi | |
if test -z "$OPENAI_API_KEY"; then | |
echo "OpenAI key is missing - \$OPENAI_API_KEY must be set" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# View registry settings | |
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | |
# Change registry settings | |
# Reverse mouse wheel scroll FlipFlopWheel = 1 | |
# Normal mouse wheel scroll FlipFlopWheel = 0 | |
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 } | |
# Restore default scroll direction | |
# Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 1 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
import sys | |
import logging | |
import json | |
from flask import Flask | |
from flask import Response, request | |
logger = logging.getLogger(__name__) | |
logger.info("Stackdriver webhook-sample starting up on %s" % (string.replace(sys.version, '\n', ' '))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2019-01-02 | |
# | |
# _______________| noise : ambient Brown noise generator (cf. white noise). | |
# | |
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave] | |
# ^minutes can be any positive integer. | |
# Command "noise 1" will display peak-level meter. | |
# | |
# Dependencies: play (from sox package) |
I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.
I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write com.apple.Dock appswitcher-all-displays -bool true | |
killall Dock |
OlderNewer