Skip to content

Instantly share code, notes, and snippets.

@btoone
btoone / eval_gist.rb
Last active February 1, 2023 21:53 — forked from petekeen-cf/eval_gist.rb
Eval Gist
# Usage:
#
# Rails
# Step 1: write a gist with a file named __script__.rb
# Step 2: copy and paste the function def below into Rails console
# Step 3: run `eval_gist("the-gist-id-from-the-url")`
# Step 4: GOTO Step 3
#
# Ruby
# Start an IRB session and load this file
@btoone
btoone / __script__.rb
Last active February 1, 2023 21:52
Hello World
puts "[#{Time.now}] Hello from GitHub!"
# Basic commands
:Git [args] # does what you'd expect
all of your `~/.gitconfig` aliases are available.
:Git! [args] # same as before, dumping output to a tmp file
Moving inside a repo.
sed -i '/pattern/d' file
sed -i.bak 's/pattern1/pattern2/g' file
@btoone
btoone / .vimrc
Last active April 9, 2019 15:03
Vimrc for use with iVim on iOS
" Set leader to be spacebar
let mapleader=" "
set hlsearch
set incsearch
set laststatus=2
set ruler
set history=100
set autoindent
set backspace=indent,eol,start
@btoone
btoone / mp-zap.py
Created May 12, 2016 11:50
Script to pull data from MemberPress using the WordPress Rest API
import json
if input['desc'] == 'MP Test':
membership = 14
elif input['desc'] == 'MP Example':
membership = 99
else:
return {'status': 'Invalid button'}
# Get member_id
<?php
add_action('supstr-process-signup', 'bnfs_webhook_process_signup', 10, 1);
function bnfs_webhook_process_signup($atts) {
$webhook_url = 'https://zapier.com/hooks/catch/1170913/2pv4l9/';
$args = array(
'method' => 'POST',
'timeout' => 30,
'redirection' => 5,
'httpversion' => '1.1',
@btoone
btoone / curl.sh
Last active August 29, 2015 14:16
Attempt to get $resource and $http to hit mapmyrun api
curl 'http://www.mapmyrun.com/vxproxy/v7.0/workout/782830271/?field_set=time_series&callback=success' \
-H 'Referer: http://www.mapmyrun.com/workout/782830271'
@btoone
btoone / Vagrantfile
Last active August 29, 2015 14:14
Setup VM and Install Docker
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENV['VAGRANT_DEFAULT_PROVIDER'] ||= 'virtualbox'
# Install Docker.io
# Adapted from https://docs.docker.com/installation/debian/
$script = <<SCRIPT
echo "[SCRIPT] Running as: `whoami`"