Skip to content

Instantly share code, notes, and snippets.

View NovaRemitly's full-sized avatar

Nova NovaRemitly

  • Remitly
  • Seattle
View GitHub Profile
@pdanford
pdanford / README.md
Last active June 15, 2024 00:02
Launching iTerm2 from macOS Finder

Launching iTerm2 from macOS Finder

(Based on info from Peter Downs' gitub but with modified behavior to open a new terminal window for each invocation instead of reusing an already open window.)

The following three ways to launch an iTerm2 window from Finder have been tested on iTerm2 version 3+ running on macOS Mojave+.

pdanford - April 2020


@andrewsomething
andrewsomething / snapshot.rb
Created February 26, 2015 21:08
Power off and Snapshot a DigitalOcean Droplet
#!/usr/bin/env ruby
require 'droplet_kit'
require 'json'
token = ENV['DO_TOKEN']
client = DropletKit::Client.new(access_token: token)
droplet_id = ARGV[0]
snapshot_name = ARGV[1] || Time.now.strftime("%b. %d, %Y - %H:%M:%S %Z")
@ericbroska
ericbroska / null.m
Last active March 31, 2016 04:41
The simple way to make NSNull act as nil: to respond with `0` (==`nil`) to any message.
/*
clang -o null -framework Foundation null.m
ericbroska
*/
#import <Foundation/Foundation.h>
#include <objc/objc-class.h>
#include <objc/runtime.h>
int main(int argc, char const *argv[])
{
@robinsloan
robinsloan / langoliers.rb
Last active June 25, 2024 17:12
The Langoliers, a tweet deletion script
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"
@edbond
edbond / reset.rb
Created November 2, 2010 13:33
Reset rails logging in script/console, redirect to console
logger = Logger.new(STDOUT)
logger.level = Logger::DEBUG
RAILS_DEFAULT_LOGGER = logger
ActiveRecord::Base.logger = logger
ActionController::Base.logger = logger
ActiveSupport::Cache::MemCacheStore.logger = logger
ApplicationController.allow_forgery_protection = false
reload!