Skip to content

Instantly share code, notes, and snippets.

@voxdolo
voxdolo / delete-dataclips.sh
Created Oct 15, 2020
Programatically export and/or delete Heroku dataclips
View delete-dataclips.sh
#!/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" \
View packages.el
(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"
View keybase.md

Keybase proof

I hereby claim:

  • I am voxdolo 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:

View gist:87e2219664a0b5c4ebc6

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
@voxdolo
voxdolo / error
Created Jun 24, 2014
Error inside vim when opening a test file with a running nrepl
View error
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
@voxdolo
voxdolo / convert
Created May 17, 2014
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
View convert
#! /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:
#
View gist:4211367
(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)))]
View view_helpers.rb
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
@voxdolo
voxdolo / decent_decorator.rb
Created Jun 1, 2012
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.
View decent_decorator.rb
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?
@voxdolo
voxdolo / attached_file.rb
Created May 17, 2011 — forked from jens/attached_file.rb
Duplicate items when using update_attributes and decent_exposure
View attached_file.rb
class AttachedFile < ActiveRecord::Base
belongs_to :parent, :polymorphic => true
end
You can’t perform that action at this time.