Skip to content

Instantly share code, notes, and snippets.

View mrmemes-eth's full-sized avatar
⚗️
creating

Stephen Caudill mrmemes-eth

⚗️
creating
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mrmemes-eth on github.
  • I am voxdolo (https://keybase.io/voxdolo) on keybase.
  • I have a public key whose fingerprint is 7026 C29F 4CAC 793C 418E D5C4 1E99 9E4B B9CA 1402

To claim this, I am signing this object:

@mrmemes-eth
mrmemes-eth / delete-dataclips.sh
Created October 15, 2020 14:19
Programatically export and/or delete Heroku dataclips
#!/usr/bin/env bash
# there were a handful of clips that I didn't want to delete versus hundreds that I did,
# so I just removed the UUIDs of the clips I wanted to keep from uuids.txt by hand
cat uuids.txt | while read uuid
do
curl \
-H "authorization: Bearer $(heroku auth:token)" \
-H "content-type: application/json" \
(defvar me-packages
'(cider clojure-mode)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
(defvar me-excluded-packages '()
"List of packages to exclude.")
(defun me/init-package-me ()
"Staging ground for my configurations for other layers"

Tested with Mac OSX Mavericks on a late 2011 MBP

My testing approach has been to erase a partition and install fresh Mavericks onto it. Run the scripts, tweak and then tear down and reinstall on the partition.

Some general thoughts:

  • if bork doesn't stop for errors, it should probably aggregate them and output post-flight
  • output can be very noisy if running scripts comingled (maybe I shouldn't be doing that though)
  • confused about what ok destination does in conjunction with ok symlink
  • at least on my system, it doesn't set where the symlink should end up and I've
@mrmemes-eth
mrmemes-eth / error
Created June 24, 2014 20:31
Error inside vim when opening a test file with a running nrepl
Error detected while processing function <SNR>47_path..<SNR>47_connect:
line 10:
E117: Unknown function: fireplace#register_port_file
E15: Invalid expression: empty(portfile) ? {} : fireplace#register_port_file(portfile, b:leiningen_root)
Error detected while processing FileType Auto commands for "clojure":
E714: List required
Error detected while processing function <SNR>47_projectionist_detect..<SNR>47_path
..<SNR>47_connect:
line 10:
E117: Unknown function: fireplace#register_port_file
@mrmemes-eth
mrmemes-eth / convert
Created May 17, 2014 22:18
Parse the CSV output from MTGO v3 client and rewrite it in a format that's compatible with the Decked Builder collection converter here: http://www.mtgo-stats.com/convert_coll/em
#! /usr/bin/env ruby
# This ruby script parses the CSV output from MTGO v3 client and rewrites it in
# a format that's compatible with the Decked Builder collection converter here:
#
# http://www.mtgo-stats.com/convert_coll/em
#
# If you're not sure how to export a CSV from the v3 client, see the
# instructions here:
#
(ns hackerfews.core
2 (:require [net.cgrand.enlive-html :as html]))
3
4 (def url (java.net.URI. "http://news.ycombinator.com/"))
5
6 (defn titles
7 [docx] (flatten (map :content (html/select docx [:td.title :a]))))
8
9 (defn numbers-in-nodes
10 [docx selector] (let [x (flatten (map :content (html/select docx selector)))]
module ClearEyes
module ViewHelpers
def self.included(base)
base.send(:attr_accessor, :image, :options)
end
def r_image( pixel_ratio )
insert_on = -File.extname(self.image).size-1
image_tag(self.image.insert(insert_on, "@#{pixel_ratio}x"), self.options)
end
@mrmemes-eth
mrmemes-eth / decent_decorator.rb
Created June 1, 2012 19:17
Simple monkey patch for decent_exposure's nu_nu branch to add automatic decoration of singular resources. Throw this in config/initializers and monkey patch your way to victory! Assumes a module like the one included.
class DecentExposure::ActiveRecord::Finder
def decorated_singular_resource
singular_resource.extend("#{singular_resource.class.name}Decorator".constantize)
rescue NameError
singular_resource
end
def resource
if plural?
@mrmemes-eth
mrmemes-eth / attached_file.rb
Created May 17, 2011 20:44 — forked from jens/attached_file.rb
Duplicate items when using update_attributes and decent_exposure
class AttachedFile < ActiveRecord::Base
belongs_to :parent, :polymorphic => true
end