Skip to content

Instantly share code, notes, and snippets.

View eestrada's full-sized avatar

Ethan Estrada eestrada

View GitHub Profile
@rsvp
rsvp / noise.sh
Last active April 18, 2024 14:18
noise : relaxing ambient Brown noise generator (cf. white noise) | Linux bash script using sox | CogSci notes
#!/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)
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@pettyjamesm
pettyjamesm / semaphore.rb
Created September 18, 2012 22:40
Ruby Semaphore Implementation
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
@mattconnolly
mattconnolly / gist:4158961
Created November 28, 2012 04:04
RSpec basic authentication helper module for request and controller specs
module AuthHelper
def http_login
user = 'username'
pw = 'password'
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw)
end
end
module AuthRequestHelper
#
@tschieggm
tschieggm / flask_server.py
Created November 22, 2013 18:51
Stackdriver webhook server example
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', ' ')))
@etscrivner
etscrivner / picture-language.rkt
Created May 27, 2015 05:43
Complete racket source code for playing with the SICP picture language.
#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)
@101v
101v / NatualScrollingInWindows.ps1
Created January 18, 2017 21:19
Powershell script to enable natural scrolling in Windows
# 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 }
@YumaInaura
YumaInaura / VIMIUM.md
Last active April 21, 2024 22:56
Vimium — Default keymap list used to Custom key mappings ( unmapAll and enable mappings you like )

Vimium — Default keymap list used to Custom key mappings

Shortcuts

# Navigating the page

map j scrollDown
map <c-e> scrollDown
map k scrollUp
@jthodge
jthodge / universal-switcher
Created September 6, 2020 22:07
Show macOS app switcher across all monitors
defaults write com.apple.Dock appswitcher-all-displays -bool true
killall Dock