This gist is updated daily via cron job and lists stats for npm packages:
- Top 1,000 most depended-upon packages
- Top 1,000 packages with largest number of dependencies
- Top 1,000 packages with highest PageRank score
chflags nohidden ~/Library | |
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true | |
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true | |
defaults write com.apple.dock autohide -bool true | |
defaults write com.apple.dock autohide-delay -float 0 | |
defaults write com.apple.dock launchanim -bool false | |
defaults write com.apple.dock magnification -bool false | |
defaults write com.apple.dock mru-spaces -bool false | |
defaults write com.apple.dock show-process-indicators -bool true | |
defaults write com.apple.dock size-immutable -bool true |
I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).
In Vim I have key bindings C-h/j/k/l
set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W
.) I'd like to use the same keystrokes for switching tmux panes.
An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\
.
Here's how it should work:
Below are the actual files we use in one of our latest production applications at Agora Games to achieve zero downtime deploys with unicorn. You've probably already read the GitHub blog post on Unicorn and would like to try zero downtime deploys for your application. I hope these files and notes help. I am happy to update these files or these notes if there are comments/questions. YMMV (of course).
Other application notes:
Salient points for each file:
#!/usr/bin/tclsh8.5 | |
# | |
# Usage: git-unmerged branch1 branch2 | |
# | |
# Shows all the non-common commits in the two branches, where non-common | |
# commits means simply commits with a unique commit *message*. | |
proc getlog branch { | |
lrange [split [exec git log $branch --oneline] "\n"] 0 400 | |
} |
This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:
Discovered an interesting algorithm for finding longest palindrome by playing with sequences in a text editor. Anyone know if there's a name for this algorithm?
Worst running time is O(n^2), which is better than the naive implementation of O(n^3) but not as efficient as some O(n) implementations (http://www.akalin.cx/longest-palindrome-linear-time). In general, assuming a non-pathological case, running time is around 2n * m where n is the length of the string and m is the mean length of all palindromes. For non-pathological cases (i.e. human sentences), n is often logarithmic (log n) and fast approaches 1 as n increases. This puts the average case complexity at around n log n and best-case n.
Developed as a solution to: http://www.therubygame.com/challenges/4
Original hand-work to discover a pattern:
# adapted from rspec-rails http://github.com/rspec/rspec-rails/blob/master/spec/rspec/rails/mocks/mock_model_spec.rb | |
shared_examples_for "ActiveModel" do | |
require 'test/unit/assertions' | |
require 'active_model/lint' | |
include Test::Unit::Assertions | |
include ActiveModel::Lint::Tests | |
# to_s is to support ruby-1.9 | |
ActiveModel::Lint::Tests.public_instance_methods.map{|m| m.to_s}.grep(/^test/).each do |m| |