Skip to content

Instantly share code, notes, and snippets.

🐦
just setting up my twttr

Odin Dutton twe4ked

🐦
just setting up my twttr
Block or report user

Report or block twe4ked

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View user_manual.md

A User Manual for NAME

Working practices:

What does your perfect working day look like?

What’s your favourite method of communication?

What are your quirks?

What qualities do you particularly value in the people you work with?

What things do people sometimes misunderstand about you?

What stresses you out / frustrates you at work?

View schema_dump.rb
# frozen_string_literal: true
class SchemaDump
VERSION_REGEX = /
^--\sDumped\sfrom\sdatabase\sversion.*$\n
^--\sDumped\sby\spg_dump\sversion.*$\n
^\n
/x
def self.call(database_url, filename:)
View git-time-spent
#!/usr/bin/env ruby
#
# Lazy sources:
#
# - https://stackoverflow.com/a/6018744
# - https://stackoverflow.com/a/4179491
require 'time'
def ranges_overlap?(a, b)
View dataset.rb
module Sequel
class Dataset
alias_method :execute_orig, :execute
def execute(*args, &block)
SequelNotifications.subscribers.each do |subscriber|
subscriber.call(*args, &block)
end
execute_orig(*args, &block)
end
View Gemfile
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
View auto_incrementing_hash_value.rb
h = Hash.new { |hash, key| hash[key] = hash.fetch(key) { hash.values.max.to_i + 1 } }
# > h['foo']
# 1
# > h['foo']
# 1
# > h['bar']
# 2
require 'securerandom'
View ruby-ascii-table.rb
# [
# {
# 'foo' => 'bar',
# 'baz' => 'qux',
# },
# {
# 'foo' => true,
# 'baz' => 1,
# },
# ]
@twe4ked
twe4ked / tmux-last-output
Created Mar 26, 2015
Grab the last output from tmux
View tmux-last-output
#!/usr/bin/env ruby
#
# The maximum length of a multiplexed packet is 32,768 bytes
#
# Unfortunately this works best (only works) if you have an uncommon character
# in your prompt to split on. I use "»".
FILE = '/tmp/tmux-pane'
PROMPT = '»'
View keybase.md

Keybase proof

I hereby claim:

  • I am twe4ked on github.
  • I am odin (https://keybase.io/odin) on keybase.
  • I have a public key whose fingerprint is E7CF B17B 6556 F44C 4D10 4B26 1ED7 776D C9D6 B110

To claim this, I am signing this object:

View spinner.css
/**
* (C)Leanest CSS spinner ever
*/
@keyframes spin {
to { transform: rotate(1turn); }
}
.progress {
position: relative;
You can’t perform that action at this time.