Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View aarongrando's full-sized avatar

Aaron Grando aarongrando

View GitHub Profile
// ==UserScript==
// @name Scryfall Oracle Search
// @namespace https://gran.do
// @version 0.1
// @description Click oracle text on Scryfall cards to search for other cards with that text.
// @match http*://scryfall.com/*
// @include http*://scryfall.com/*
// @copyright 2020+, Aaron Grando
// @require http://code.jquery.com/jquery-latest.min.js
// @match http*://scryfall.com/*

Keybase proof

I hereby claim:

  • I am aarongrando on github.
  • I am grando (https://keybase.io/grando) on keybase.
  • I have a public key whose fingerprint is DED9 A3A8 552D 20C1 7E65 02C1 1CAB 626B 6E97 EBAD

To claim this, I am signing this object:

@aarongrando
aarongrando / Image Extractor
Created July 10, 2013 16:53
Relies on the `twitter-text` and `postgres_ext` gems. Model methods on a "Post" model with an `images` column (array of strings) and `text` column (the post's text)
class Post < ActiveRecord::Base
include Twitter::Extractor
def parse_images
images_array = Array.new
extracted_links.each do |link|
if looks_like_an_image?(link)
url = URI.parse(link)
Net::HTTP.start(url.host, url.port) do |http|
if http.head(url.request_uri)['Content-Type'].start_with? 'image'
➜ pifa-2013 git:(master) cap deploy
* 2013-01-29 09:37:56 executing `deploy'
* 2013-01-29 09:37:56 executing `deploy:update'
** transaction: start
* 2013-01-29 09:37:56 executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:redtettemer/PIFA-2013.git HEAD"
command finished in 1019ms
* executing "if [ -d /var/www/rails_apps/PIFA/shared/cached-copy ]; then cd /var/www/rails_apps/PIFA/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 727257991e0d9ff97d6ebe039c7872ae249f6351 && git clean -q -d -x -f; else git clone -q git@github.com:redtettemer/PIFA-2013.git /var/www/rails_apps/PIFA/shared/cached-copy && cd /var/www/rails_apps/PIFA/shared/cached-copy && git checkout -q -b deploy 727257991e0d9ff97d6ebe039c7872ae249f6351; fi"
servers: ["vs829458.blueboxgrid.com"]
@aarongrando
aarongrando / gist:1635158
Created January 18, 2012 19:53
jQuery UI Autocomplete Facebook Friends
$(function() {
// Depends on: jQuery, jQuery UI core & widgets (for the autocomplete method)
// Assumes you're already including the FB JS SDK asynchronously...
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxxxxxxxxxxxxxxx', // App ID
status : true, // check login status
Item.find(:first, :offset => (rand Item.count))
class PrintsController < ApplicationController
# GET /prints/post
def post
@print = Post.find(params[:id])
respond_to do |format|
format.html # post.html.erb
end
end