Why not [*param[:emails]]
?
This is AWESOME.
This should be in standard.
https://coderwall.com/p/vbq-ra - the best are fix
and todo
.
Width of the TMux. It is used to determine which element's should be shown.
Personally I prefer CarrierWave over PaperClip. Much cleaner IMHO. Also instead of Slime has nicer syntax IMHO.
@creaktive - now there is Gist: https://gist.github.com/8127857
@creaktive - I would, and I will, but after Christmas. Yeah, but tmux-powerline is now abandoned and Lokaltog version depends on Python. This one is pure shell (I use Airline for Vim).
@yeraze there are Powerline separators (so you need patched font). Codes are LSEP
= 0xEE 0x82 0xB0
, RSEP
= 0xEE 0x82 0xB2
, RSEPE
= 0xEE 0x82 0xB3
. But you can try other chars.
@jailbot it's to simplify implementation of weak typing. If JavaScript used Integers it will add another layer of abstraction to Number. Other interpreted languages have difference between Int and Floats (like Ruby, Python or Smalltalk) but changes between types can be fluid (like /
in Python or Smalltalk, first return Float, second Fraction).
There is better option:
alias_method :fois, :times
@xander there are no "integers" in JS. IMHO in most cases you shouldn't bother yourself about that one is floating-point or integer. If you need to be sure that this is integer then use Math.floor
, Math.ceil
or Math.round
. No matter if you expect Number or String.
Simpler way:
> str = '173234786123874612'
'173234786123874612'
> +str
173234786123874620
I preffer the first snippet. If you want to be sure that you're safe about your trap, you can always do this:
def method(*args)
args.flatten!
# blablabla
end
Do not use git status
without --porcelain
flag in your scripts. My version using "normal" AWK
git status --porcelain | awk '/^ M/ { print $2 }'
I preffer rbenv.
But why? When you call git log <sha>
you will get the date and time of commit.
Or use PRY :D
Why not ~
?
Why not simply git config --edit
?
Why not use rbenv
?
Or create another folder and symlink all your dotfiles to this.
@dtao to thank me just keep working on Lazy.js. IMHO it is great library and is much better than Underscore, so keep going.
@dtao for symbols is %i
. Also in Ruby 2.0 there is **
(splat splat) operator for named arguments, so:
def foo(**args)
p args
end
foo(a: 10, b: 20) #=> {:a => 10, :b => 20}
In Ruby, "splatted" argument may be in the middle, so function like this:
def first_middle_last(first, *middle, last)
p first, middle, last
end
is fully correct and functional:
first_middle_last(1, 2) #=> 1, [], 2
first_middle_last(1, 2, 3, 4) #=> 1, [2,3], 4
IE7 and 8 have conditional comments so you don't have to use JS.
My most used
3251 g
1051 e
877 ls
753 rm
690 y
475 cat
358 less
355 sudo
351 cd
302 echo
Pretty big usage of Git and Vim.
My version is a little bit longer:
function most-used --description 'Print most used commands'
history | awk '{print $1}' | sort | uniq -c | sort -rn | head $argv
end
Yes. You can use Vim -u <vimrc>
option.
I prefer using sed -i
.
In first example all is caused that your usage of before_save
is invalid. You should use after_initialize
instead. In second example nicer would be BlahMailer.blah_notifier(self).deliver or true
which also always return truth value, but if first statement is successfull then return value returned by that method.
There is also alternative command :x
. ZZ
shortcut is nice, but I have some written on my own:
-
ZX
- mapped to:cq
which quits with error (useful when dealing with Git) -
ZA
- quit all without saving (:qa
) -
ZS
- quit all with saving (:xa
)
I had cannot understand quick sort until I found Haskell and this:
quicksort :: Ord a => [a] -> [a]
quicksort [] = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
where
lesser = filter (< p) xs
greater = filter (>= p) xs
I wolud write Haskell code some other way:
mod3 :: Int -> Int
mod3 = reverse mod 3
mod5 :: Int -> Int
mod5 = reverse mod 5
select35 :: [Int] -> [Int]
select35 = select mod5 $ select mod3
main :: IO ()
main = print . sum . select35 [1..1000]
@royletron, yes convention.You should keep some organisation in your code. For me app/
folder is only for my application code, not for any library.
Also I don't keep any of Bower installed libs in Git repo. All of them are downloaded on server before assets:precompile
to keep application repository with only my app code. IMHO it is the best options. If you wan't store external libs in your Git tree then you should think about using Git submodules instead of Bower.
DO NOT USE app/assets/
FOR EXTERNAL ASSETS.
For this you have vendor/assets
. Next thing is that then you do not need to place all your assets in extra folder.
@erivello: Then why not simply use git gc --prune=now
? Also using Git to version binary files is bad idea. Maybe it will be fixed in 2.0, but I bet that it won't.
I prefer using Tabular gem.
I would rather use <Leader>fy
as <Leader>y
is nicer to have binded to "+y
.
@raymondchou - because RVM sucks.
PS use rbenv
.
Why the hell anybody should do that?
Except that I disagree with using git pull
it is nice idea.
Do not use #create
in seeds.rb
. Use #create!
to be sure that your models are created.
I prefer have it as a git aliases than as a shell aliases. It is more general then.
I still doesn't see use-case for assignment in view.
Why not use gp
instead p
? Works out-of-the-box.
You can use simpler and faster di}
(assume you are inside the block).
There are 2 ways to do it better:
-
use address alias (add this to
.gitconfig
and then use itgit clone gh:name/repo
):[url "git@github.com"] insteadOf = gh
use Hub
@vohof: find
look for all files that ends with .m
, then awk
wraps each line (found file) with "
(quotes), count lines, and sort by it.
Why not use killall
?
Or you can use gp
instead p
.
Better idea is to select text to indent and use >>
, =
or :retab
You forgot -n
flag in sort
Also for Git projects you can use:
git ls-files '*.m' | xargs wc -lm | sort -n
Or you can try rem
values.
@limpangel: I used Vundle for some time, but I cannot get along with it so I switched to Pathogen. But using submodules is really awesome idea.
Also I don't like and don't recommend installing NERDtree. There is no usage of this (you can use built in :e dir
command) and only confuse user. My own configuration (and come other confs also) can be found at https://github.com/hauleth/dotfiles
Why not simply add pry-rails
gem? IMHO a little bit easier and cleaner.
For me it is nasty usage of Bash aliases. It is better to use Git aliases instead, i. e instead your gitassumeunchanged
I have git skip
(git config --global alias.skip update-index --assume-unchanged
).
You forgot about git rebase -i
for squashing
Also nice is :xa
which save and quit all files. In case to use it as ZZ
(save and quit) I have mapped some more:
map ZX :cq " quit and return error (helpful when using Vim with Git)
map ZA :qa " quit all buffers
map ZS :xa " quit and save all buffers
Isn't deviantArt something like that?
Why not use Karma instead.
Or you can use Hub which provide some more features.
@jtomaszewski Fish allow setting empty variables so there is no need to create fallback to empty string, so if there is no arguments then rbenv
will be called without any arguments. Everything works as expected.
@jtomaszewski give example when this snippet doesn't work. I cannot found that one. But if it really bother you then you can write set -l command "$argv[1]"
.
@jtomaszewski There is no need to do that. In fish (like in any other shell) when you try to access to non-existent variable then you get empty value.
The best of it is that it propely work with tag closing. http://jsfiddle.net/nxeGZ/12/
@enlavin I use fish and there it work that way also but not for -
, so I write it down also.
Why not git log --since=$(date +%U)
?
@jacaetevha so what's the problem? Then you simply write:
git recent-branches --count=1
I will override previous flag.
Why that way and not simply:
[alias]
recent-branches = for-each-ref --sort=-committerdate --count=10 --format='%(refname:short)' refs/heads/
@glitchmr not only you :)
Or just start using Pry.
Don't like that solution. IMHO better is using in-code TODOs and my git todo
alias, external TODO
file or use git notes
.
IMHO better idea is to use YAML array:
en:
steps:
- do this
- do that
- do this again
and then you can use it as an normal array:
<ul>
<%- t('steps').each do |step| -%>
<li><%= step %></li>
<%- end -%>
</ul>
@bartlomiejdanek I understand what you mean but my point is that sometimes I work on bunch of files and I wanna commit only part of them. Then your hook will unable me to do that if in some of them I still have, i.e. a binding.pry
. In my way it stop you if and only if you have that in code that you are trying to commit.
@bartlomiejdanek but why bother about untracked/unindexed files? Maybe I still workin on them and I want commit only that files. Then your hook will unable me to do sa if I don't disable hooks for this commit. IMHO that much better idea to check only indexed and commited files, not all.
As I see, you use grep
command. As this hook work on Git-only repositories why not use git grep --cached
? It will work faster and you won't need to run git diff-index --name-only HEAD --
.
Also I will move keywords to Git config. Then you can add this as template and for every project you can have another keywords that you don't want to see in public repo.
You can also use some kind of compressor that find the same selectors and merge them into one block.
Why are you using #map
? #to_a
is much better.
Please, use lib/
and vendor/
for assets that are not strictly connected with your app.
Don't work for me (crashing on Ruby 1.9.x)
@gahtune not IDE. A tool like Rake or Capistrano that will only manage projects and run required apps/daemons. No editor or something like that. You should use editor of your choice (I use Vim and I'm happy).
@gahtune My goal is to write tool that will read some config file inside that dir and run processes needed in development mode like Guard, DB process or something like that (maybe in screen processes).
C++:
string Christmas = "beer ";
string NewYear = "more beer";
if (Christmas + NewYear == "beer more beer")
cout << "festive hangover\n";
Haskell:
let after a b = if b ++ a == "beer more beer" then "festive hangover" else ""
let Christmas = "beer "
let NewYear = "more beer"
main = putStrLn $ NewYear `after` Christmas
D:
string Christmas = "beer ";
string NewYear = "more beer";
if (Christmas ~ NewYear == "beer more beer")
writeln("festive hangover");
Try fish, it awesomness beat ZSH twice.
Much simpler, and more acceptable is:
task :invoke_another_task => %w[another:task one:another:task]
I would prefer skip
aliases instead of ignore
because I use ignore
command to add file to .gitignore
.
Here you have my choise http://lukasz.niemier.pl/post/34779937734/legit-master
Why not use hub
?
For GitHub you can also install hub
and use only git clone name/repo
Sometimes break
is better. For example if we want to escape from #each
.
I prefer Redcarpet gem that use Sunshine native library. It's faster and has a little bit better support (at least GitHub is not small company).
Use pry
to quickly resolve any Ruby argument.
@shadowfiend Yes, but sometimes Compass is over bloated or i.e. we are creating independent theme/framework (like Bootstrap or MetroUI), not whole website frontend. Then not relying on any existing framework is good idea.
You can accomplish that also by selecting your code and hitting <kbd>Tab</kbd>
@gavinblair I will check it when I switch to Windows. What version of Git you have?
I've always wandering why not simply font-size: 0px;
?
@clowder and even git config alias.update 'pull --rebase origin master '
and then running just git update
.
Great theme, but I still prefer bira
:)
Great nerd joy.
Faster and easier is
cd $(git rev-parse --show-toplevel)
Let me get it straight: