A web-page, more-readable version of the code by praptak on https://news.ycombinator.com/item?id=4956101.
# environment setup | |
# this is CoffeeScript (http://coffeescript.org/) | |
# and I'm using the Underscore.js library (http://underscorejs.org/) | |
log = console.log | |
testFunctionUsingTestCases = (fun, funName, testCases) -> | |
for testCase in testCases | |
expectedResult = _(testCase).first() |
@mixin all-but-first($property, $normal-value, $value-for-first: 0) | |
#{$property}: $normal-value | |
&:first-child | |
#{$property}: $value-for-first | |
@mixin all-but-last($property, $normal-value, $value-for-last: 0) | |
// won't work in IE8 or below; :last-child not supported | |
#{$property}: $normal-value | |
&:last-child | |
#{$property}: $value-for-last |
// ==UserScript== | |
// @name Hide GitHub Project Page Latest Commit | |
// @namespace roryokane | |
// @include /^https?://github\.com/[^/]+/[^/]+/?$/ | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js | |
// ==/UserScript== | |
// GreaseMonkey doesn't fire on pushState and popState right now, | |
// so the box is reshown and not rehidden when going forward and back to the page again | |
// TODO work around – at least make toggle link recognize when it’s been thwarted |
I had a pretty elaborate vim setup https://github.com/mbriggs/dotvim, and now I am using emacs with evil. I’ll go through the reasons why, with a giant caveat being I actually don’t care what editor anyone who reads this uses, so long as they learn it and it works for them. As someone who has used both, vim shines for people who aren’t in to heavy customization. You can heavily customize vim, but it is so easy to make it dog slow, and even with a ton of work you won’t hit what you can accomplish in emacs. Here are some examples, and also essentially why I am no longer using vim, YMMV
If I want to run a command and have it pipe to another buffer AND not completely lock up the editor, I can do that with a few lines and compilation-mode. This is next to impossible in vim. I can split my editor window and have a shell running on the other side, that i can use all the keys and tools on that I use to edit code, again, not possible in vim. I can have a repl connected to my editor that the editor uses for auto-compl
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Blank page with single-color background</title> | |
<style> | |
body { | |
color: black; | |
background-color: black; |
1.9.3-p194 |
html {zoom:1.32;} | |
img, a[href=news] {zoom:.76;} | |
/* choose one: */ | |
body * {font-family:'Helvetica Neue', Helvetica, 'Liberation Sans', sans-serif !important;} | |
/* body * {font-family:Palatino, 'Liberation Serif', Georgia, serif !important;} */ | |
a[href=news] {font-family:Palatino, 'Liberation Serif', Georgia, serif !important;} | |
code {font:10px/1.5 Menlo, monospace !important;} |
class LocaleChooser | |
LOOKUP_CHAIN = [:params, :user, :session, :http, :default] | |
def self.set_by(inputs) | |
locale = nil | |
LOOKUP_CHAIN.each do |lookup| | |
locale = send("by_#{lookup}", inputs[lookup]) | |
break if locale |
LOOKUP_CHAIN = [:params, :user, :session, :http, :default] | |
def self.set_by(inputs) | |
LOOKUP_CHAIN.find_mapped do |lookup| | |
locale = send("by_#{lookup}", inputs[lookup]) | |
end | |
end |