Skip to content

Instantly share code, notes, and snippets.

View ambethia's full-sized avatar
🐼
PANDAS!

Jason L Perry ambethia

🐼
PANDAS!
View GitHub Profile
@ambethia
ambethia / gist:4d1c8fa7246c14b5c48c
Created November 25, 2014 06:48
Enable Assistive Devices for `osascript` on Mavericks and Yosemite
sudo sqlite3 /Library/Application\ Support/com.apple.TCC/tcc.db "INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','/usr/bin/osascript',1,1,1,NULL)"
@ambethia
ambethia / bio.md
Last active August 29, 2015 14:20

Jason is a native Floridian who started building for the web as a teen in the mid-'90s. He's been a Rubyist for about as long as anybody, founding the Tampa Ruby Brigade in 2006 and taking great pride in being an active leader in the local tech community. After stints in academia, startups, and as a consulting freelancer, he has found great joy in mentoring and sharing the knowledge gained over his career. He's also a game development enthusiast with a love for 3D modeling and animation. Jason is a father, a skeptic, entirely too opinionated, and prefers a word count with a power of two. When the world gets heavy you can find him either building LEGO® as catharsis or harnessing his power animal-- the panda bear.

@ambethia
ambethia / airplane.c
Last active August 29, 2015 14:20
Lets talk about gist
#include airplane.h
function main() {
int i = 0;
return 0;
};
// bah!

Normal Mode

How many users are there?

SELECT COUNT(*) FROM users;

What are the 5 most expensive items?

SELECT * FROM items ORDER BY price DESC LIMIT 5;

@ambethia
ambethia / Gemfile
Last active August 29, 2015 14:23
Rails 5 (edge) API app
source 'https://rubygems.org'
ruby '2.2.2'
gem 'rails', :github => 'rails/rails'
gem 'arel', :github => 'rails/arel'
resources :books
# is short hand for:
get 'books' => 'books#index' #as => 'books'
post 'books' => 'books#create' #as => 'books'
get 'books/new' => 'books#new', :as => 'new_book'
get 'books/:id/edit' => 'books#edit', :as => 'edit_book'
get 'books/:id' => 'books#show', :as => 'book'
patch 'books/:id' => 'books#update' #as => 'book'
#!/usr/bin/env ruby
require 'net/http'
require 'json'
require 'cgi'
class Card
SUITS = [
"Diamonds",
"Hearts",
@ambethia
ambethia / Vendor Trash
Created November 15, 2008 04:39
Vendor Priority
Sorted by sell value, low to high. Not always
accurate, but this seems to be the general pattern.
Item classes on the same line generally have
the same value.
2H Weapons
1H Weapons
Ranged
Plate Chest/Legs
Sheild
@ambethia
ambethia / Clean Branch
Created January 20, 2009 23:42
Removing the history from a new branch
git symbolic-ref HEAD refs/heads/newbranch
rm .git/index
git clean -fdx
<do work>
git add your files
git commit -m 'Initial commit'
@ambethia
ambethia / mount.rb
Created March 9, 2009 18:50
Trying to make myself feel better about how many times I've killed Anzu now.
require "rubygems"
require "gruff"
graph = Gruff::Line.new
graph.title = "Drop the damn mount already..."
graph.data("%", (1..800).map { |y| (1 - (0.99 ** y)) * 100 })
graph.labels = {0 => "1", 50 => "50", 100 => "100", 250 => "250", 500 => "500", 750 => "750+"}