サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
やる気の出し方
caiustheory.com
2017-09-26 11:00:23Ever found you’ve accidentally entered too many gits in your terminal and wondered if there’s a solution to it? I quite often type git then go away and come back, then type a full git status after it. This leads to a lovely (annoying) error out the box: What a git. My initial thought was overriding the git binary in my $PATH and having it strip any leading arguments that match g
2013-01-23 11:07:43Here be hax. Don’t ever do these. ;-) Reduce local variables with instance_evalSometimes (usually in a one-liner) I want to do some work with a value without assigning it to a variable. Chucking an #instance_eval call in there will set self to the value, which saves having to assign it to a local value. Pretty much only used by me in one-off scripts or cli commands. Good start_d
2013-01-16 12:23:54Here’s a few things I refactor as I write code down initially. Not entirely convinced it’s strictly refactoring, but it’s how I amend from one pattern I see in a line or three of code into a different structure that I feel achieves the same result with cleaner or more concise code. Multiple equality comparisonsTesting the equality of an object against another is fairly simple, j
2013-01-08 19:09:42In a ruby script, there’s a keyword __END__ that for a long time I thought just marked anything after it as a comment. So I used to use it to store snippets and notes about the script that weren’t really needed inline. Then one day I stumbled across the DATA constant, and wondered what flaming magic it was. DATA is in fact an IO object, that you can read from (or anything else y
2010-03-18 22:32:45There’s a few useful shorthand ways to create certain objects in Ruby, a couple of obvious ones are [] to create an Array and {} to create a Hash (Or block/Proc). There’s some not so obvious ones too, for creating strings, regexes and executing shell commands. With all of the examples I’ve used {} as the delimiter characters, but you can use a variety of characters. Personally I
2009-02-24 16:11:05Updated 2009-06-09: This post is for the Safari 4 beta and will not work with the new Safari 4 released yesterday at the WWDC keynote. I’ve had a look through that release and can’t see any way to revert the address bar, etc sorry. Having a quick poke through the new Safari binary yields the following strings: $ strings /Applications/Safari.app/Contents/MacOS/Safari | grep Debug
このページを最初にブックマークしてみませんか?
『caiustheory.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く