Skip to content

Instantly share code, notes, and snippets.

@lackac
lackac / ibook_paste
Last active August 5, 2018 15:26
1. Copy from iBooks a code snippet; 2. Run ibook_paste; 3. Paste into text editor
#!/usr/bin/env bash
pbpaste \
| ruby -ne '
BEGIN { $blanks = [] }
if ($_ =~ /^\s*$|^Excerpt From: */)
$blanks << $_
else
puts($blanks)
$blanks = []
@lackac
lackac / coop.ledger
Last active December 6, 2020 12:46
C 1.0000d = 8h ; 8-hour work days
D £1,000.00 ; default currency and formatting
; First approach: automatically set value for work delivered by person at their
; current rate
; Issue: since time is seconds-based the day rate needs to be divided by 1 day
; to arrive at the 'second rate'. This somehow is rounded to two decimals which
; means that the below is incorrect when being used. It will result in a
; multiplier that's either `0.01` or `0.02`.
= /^Work:Client:Project:Alice/
@lackac
lackac / components.my-block.js
Last active July 4, 2017 12:10
Array of CSS classes in property referenced from classNameBindings
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['block'],
classNameBindings: ['cssClasses'],
cssClasses: ['foo', 'bar', 'baz']
});
@lackac
lackac / 00_README.md
Last active September 24, 2015 07:58
Gourmet Service Object presentation for budapest.rb on 2015-09-23
@lackac
lackac / README.md
Last active August 29, 2015 14:20
Bookmarklet: Make columns collapsible on a Jira Agile Board

It would be nice if you could just drag a link to your toolbar, but GitHub sanitizes javascript: links in Markdown (which is a good thing, really). Therefore you'll have to do this manually. Create a bookmark with the following URL content:

javascript:(function()%7Bvar%20s%3Ddocument.createElement('script')%3Bs.src%3D'https%3A%2F%2Fgist.githack.com%2Flackac%2F03c6d1921bde0b97e050%2Fraw%2Fcollapsible_jira_board.js'%3Bdocument.getElementsByTagName('script')%5B0%5D.parentNode.appendChild(s)%7D)()

Keybase proof

I hereby claim:

  • I am lackac on github.
  • I am lackac (https://keybase.io/lackac) on keybase.
  • I have a public key whose fingerprint is D84B F126 11B5 B211 3510 0996 7AC6 E86E E9E4 8853

To claim this, I am signing this object:

@lackac
lackac / 2_ways.md
Last active August 29, 2015 13:57
2 Ways to Decompose Fat ActiveRecord Models – budapest.rb 03/2014
@lackac
lackac / styles.less
Last active August 29, 2015 13:56
Visual indication of which pane is active for Atom
/* this is the settings I use for the Solarized Light theme, change
* the colors and loose the import if you're using another theme */
@import "variables";
.pane .editor-colors {
background-color: @base2;
}
.pane.active .editor-colors {
background-color: @base3;
@lackac
lackac / config.coffee
Created October 25, 2012 14:31
Simple configuration which is overridable through env vars
# Find the appropriate setting for the provided key
module.exports = config = (key) ->
# return setting from environment variable
if env_value = process.env[key.toUpperCase()]
try
return JSON.parse(env_value)
catch err
if err instanceof SyntaxError
return env_value
else
@lackac
lackac / softlayer_upgrade.rb
Created October 5, 2012 08:48
Script for upgrading the number of CPU cores and the amount of memory in SoftLayer Computing instances
#!/usr/bin/env ruby
require 'rubygems'
require 'softlayer_api'
if ARGV.size != 3
STDERR.puts "USAGE: #{$0} hostname cores mem"
exit 1
end