This is a list of the SublimeText 2 addons I use for my development environment.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_doing() | |
{ | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
COMPREPLY=( $(compgen -W "$(doing help -c)" -- $cur) ) | |
} | |
complete -F _doing doing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IMPORTANT NOTE: This hack has evolved, and HistoryPx is now a full PowerShell module | |
# that is hosted on GitHub and can be found here: github.com/KirkMunro/HistoryPx | |
# First set up some interesting hacks | |
New-Module -Name HistoryPx -ScriptBlock { | |
$PSModule = $ExecutionContext.SessionState.Module | |
$global:__ = $null | |
$global:MaximumDetailedHistoryCount = 50 | |
$global:PSDefaultParameterValues['Out-Default:OutVariable'] = 'global:__' | |
$commandHistory = [ordered]@{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark/ips' | |
a = (0..10).to_a | |
Benchmark.ips do |x| | |
x.report("push") { a.dup.push(100) } | |
x.report("shovel") { a.dup << 100 } | |
x.report("concat") { a.dup.concat([100]) } | |
x.report("+") { a + [100] } | |
x.report("unshift") { a.dup.unshift(100) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set ts=2 sw=2 et ai ft=ruby: | |
# Idea from here: | |
# http://userprimary.net/posts/2011/01/10/optimizing-nanoc-based-websites/ | |
# Also uses code from other filters that are shipped with Nanoc itself. | |
# | |
# Implementation enhanced by Pascal Bleser <loki@fosdem.org>, | |
# under either GPL2 (GNU General Public License) or ASL2.1 (Apache Software License) | |
# or BSD-3-Clause, as you wish (short version: do whatever you want with it ;)). | |
# |
See https://www.youtube.com/watch?v=4_RJu_TrqO0&feature=youtu.be&t=8h6m40s
$ ruby dilute.rb fib.rb
def fi n
if n < 3
1
else
fib(n-1 + ib(n
end
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def package?(file) | |
results = `mdls -name kMDItemContentTypeTree "#{file}" | grep com.apple.package` | |
results.length > 0 | |
end | |
base = ARGV[0] | |
if !base | |
script = File.basename("#{__FILE__}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# SIFTTTER 1.5: An IFTTT-to-Day One Logger by Craig Eley 2014 <http://craigeley.com> | |
# Based on tp-dailylog.rb by Brett Terpstra 2012 <http://brettterpstra.com> | |
# Multiple Date Function by Paul Hayes 2014 <http://paulrhayes.com> | |
# | |
# Notes: | |
# * Uses `mdfind` to locate a specific folder of IFTTT-generated text files changed in the last day | |
# * The location of your folder should be hardcoded in line 67, and the location of your Day One in line 66 | |
# * Scans leading timestamps in each line matching the selected dates | |
# * Does not alter text files in any way |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# Marked 2 preprocessor | |
# Allows use of `*` link references where the next [*]: href defines the link | |
# Inspired by [tidbits][*] | |
# [*]: http://tidbits.com | |
if RUBY_VERSION.to_f > 1.8 | |
input = STDIN.read.force_encoding('UTF-8') | |
else | |
input = STDIN.read |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep -B6 bindings:.*: |
OlderNewer