Skip to content

Instantly share code, notes, and snippets.

View eebbesen's full-sized avatar
🇺🇸

J2EEbbesen eebbesen

🇺🇸
View GitHub Profile
# get base samples
all_samples = SonicPi::Synths::BaseInfo.class_eval '@@grouped_samples'
# show all sample headings
puts all_samples.keys.sort
# [:ambi, :bass, :bd, :drum, :elec, :glitch, :guit, :loop, :mehackit, :misc, :perc, :sn, :tabla, :vinyl]
# access samples for a heading
puts all_samples[:drum][:samples]
@eebbesen
eebbesen / summ.rb
Last active August 23, 2020 11:41
Combinations of three addends that equal a sum. Solves West of Loathing's Soupstock Lode puzzle.
#!/usr/bin/env ruby
THREE = 411
FIVE = 295
SEVEN = 161
GOAL = 3200.0
def build_collection(n)
t = (GOAL/n).floor
[].tap do |v|
@eebbesen
eebbesen / pid_kill.rb
Last active July 29, 2020 14:39
stop a bunch of processes with regex match
ret = `ps -ef | grep steam`
rows = ret.split "\n"
pids = rows.collect { |row| row.split(' ')[1] }
pids.map { |p| `kill #{p}` }
@eebbesen
eebbesen / stop_inbound_twilio.md
Last active June 5, 2020 21:11
Stop reply message for inbound SMS to a Twilio number
  1. Click hash (Phone Numbers) in left hand doc
  2. Click Active Numbers
  3. Click the phone number you want to work on
  4. Scroll down to Messaging
  5. Select TwiML Bin from the A Message Comes In drop down
  6. Click the red button with the white plus sign
  7. Enter some name for the action
  8. Enter
@eebbesen
eebbesen / windows-rails.md
Last active June 1, 2020 01:22
Windows 10 Rails installation -- 05/31/2020

Setup -- last updated on 05/31/2020

  • used the latest version of Modern IE Windows 64

    • initial OS build 17763.379
    • also worked after update to 17763.1217
  • used Ruby+Devkit 2.6.6-1 (x64)

    • accepted all defaults
  • used Python 2.7.15 from npm install windows-build-tools

# deleting Pipfile.lock helps me get past `pipenv install --dev`
~/p3/mnpay/server$ rm Pipfile.lock
~/p3/mnpay/server$ python -V
Python 3.7.4
~/p3/mnpay/server$ pipenv --version
pipenv, version 2018.11.26
~/p3/mnpay/server$ pipenv install --dev
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
✔ Success!
~/p3/mnpay/server$ python -V
Python 3.5.0
~/p3/mnpay/server$ pipenv install --dev
Installing dependencies from Pipfile.lock (5f2093)…
Looking in indexes: https://pypi.python.org/simple:00:00
Collecting pandas==0.22.0 (from -r /var/folders/fq/h5lcy11s1g33j6v0mqxvmwd1ty0pdl/T/pipenv-3eb_8f4m-requirements/pipenv-64ok83go-requirement.txt (line 1))
Using cached https://files.pythonhosted.org/packages/08/01/803834bc8a4e708aedebb133095a88a4dad9f45bbaf5ad777d2bea543c7e/pandas-0.22.0.tar.gz
Installing build dependencies: started
Installing build dependencies: still running...
Installing build dependencies: still running...
@eebbesen
eebbesen / require_recaptcha.rb
Last active June 3, 2019 13:09
Require reCAPTCHA during tests with recaptcha and devise gems. Take care to reset the `Recaptcha.configuration.skip_verify_env` Array at the end and/or beginning of each test since changes persist across tests.
def require_recaptcha(y=true)
r = Recaptcha.configuration.skip_verify_env
y ? r.delete('test') : (r.push('test') unless r.include?('test'))
end
@eebbesen
eebbesen / blob_to_file.md
Last active February 13, 2019 15:42
Save MS SQL Server blob to file

Values in <> are ones you need to populate

  1. brew install freetds
  2. gem install bundler
  3. mkdir artifacts
  4. create config.yml
default: &default
  adapter: sqlserver
 pool: 1
@eebbesen
eebbesen / gc.sh
Created October 24, 2018 12:29
script to set local git username and email
#!/bin/bash
eval `git config --local user.name "$1"`
eval `git config --local user.email "$2"`
# ./gc.sh eebbesen eebbesen.git@gmail.com