This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Deathsie Card Previews | |
// @namespace Violentmonkey Scripts | |
// @include https://docs.google.com/spreadsheets/d/e/2PACX-1vR1eo40sfGoZ-MLxXZsGRHEeAWlKBHYxLFGbTY64l0ZFmsXN25iXOHRYvN7Dt4AsCalgj_RK7KAMr9G/pubhtml | |
// @grant none | |
// @version 1.0 | |
// @author George Ogata | |
// @description 9/13/2021, 1:34:27 AM | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'ostruct' | |
require 'set' | |
require 'nokogiri' | |
CARDS_PATH = '~/Library/Application Support/Cockatrice/Cockatrice/cards.xml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'time' | |
class App | |
CUTOFF_DAYS = 30 | |
def initialize(args) | |
args.size <= 1 or | |
abort "USAGE: #$0 [remote]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
keep = `git config git-delete-merged-branches.persist`.strip.split(',') | |
puts "preserving: #{keep.join(', ')}" | |
current_branch = `git rev-parse --abbrev-ref HEAD`.strip | |
`git branch --merged`.lines.each do |line| | |
next if line =~ /\A\* / | |
branch, target = line.strip.split(' -> ', 2) | |
next if keep.include?(branch) || keep.include?(target) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RDownloadStrategy < SubversionDownloadStrategy | |
def stage | |
quiet_safe_system "cp", "-r", @clone, Dir.pwd | |
Dir.chdir cache_filename | |
end | |
end | |
class R < Formula | |
homepage "http://www.r-project.org/" | |
url "http://cran.rstudio.com/src/base/R-3/R-3.1.2.tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
keep = `git config git-delete-merged-branches.persist`.strip.split(',') | |
puts "preserving: #{keep.join(', ')}" | |
current_branch = `git rev-parse --abbrev-ref HEAD`.strip | |
`git branch --merged`.lines.each do |line| | |
next if line =~ /\A\* / | |
branch, target = line.strip.split(' -> ', 2) | |
next if keep.include?(branch) || keep.include?(target) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
###################################################################### | |
# | |
# Open the given file names in Aquamacs. | |
# | |
# If the user already has an Aquamacs process open, use it. | |
# Otherwise, fire up a new one. Only Aquamacs instances without a | |
# controlling terminal (i.e., those running in a window) will be | |
# selected. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Demonstrates the superiority of Goliath over Unicorn for a single-process app | |
# handling file uploads. | |
# | |
# This program runs in 3 modes: | |
# | |
# ./goliath-vs-unicorn goliath - Runs the goliath server on the default port (9000) | |
# ./goliath-vs-unicorn unicorn - Runs the unicorn server on the default port (8080) | |
# ./goliath-vs-unicorn upload - Upload 5 files in parallel to the port given by -p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
attr_reader :full_name, :age, :profession, :favorite_food | |
def initialize(full_name, age, profession, favorite_food) | |
@full_name = full_name | |
@age = age | |
@profession = profession | |
@favorite_food = favorite_food | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.class_eval do | |
def self.ignore_columns(*names) | |
extend ColumnIgnorance | |
ignored_columns.merge names.map(&:to_s) | |
end | |
module ColumnIgnorance | |
def columns | |
return @columns if @columns | |
@columns = super.reject do |column| |
NewerOlder