Skip to content

Instantly share code, notes, and snippets.

View a1ip's full-sized avatar
🎯
Focusing

Philippe Rigovanov a1ip

🎯
Focusing
View GitHub Profile
@a1ip
a1ip / fizzbuzz.js
Created May 31, 2014 16:06
Elegant JavaScript bodyless for loop FizzBuzz one-liner from http://rosettacode.org/
for(var i=1; i<=100; console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i), i++);
@a1ip
a1ip / fizzbuzz.js
Created May 31, 2014 16:08
Elegant JavaScript FizzBuzz one-liner from http://rosettacode.org/
for (var i=1; i<=100; i++) console.log( (i % 3 === 0 ? 'Fizz' : '') + (i % 5 === 0 ? 'Buzz' : '') || i );
@a1ip
a1ip / fizzbuzz.coffee
Created May 31, 2014 17:21
My elegant CoffeeScript FizzBuzz one-liner
console.log(['Fizz' if i % 3 is 0] + ['Buzz' if i % 5 is 0] or i) for i in [1..100]
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _is_git_dirty
echo (git status -s --ignore-submodules=dirty ^/dev/null)
end
function _rb_prompt
echo (rvm info | awk '{print $1}')
# name: wkf
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for FISH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
## Set this options in your config.fish (if you want to :])
@a1ip
a1ip / loop.coffee
Created June 17, 2014 08:19
Simple FOR loop in CoffeeScript
logobject = (o) ->
console.log "#{k} = #{v}" for k, v of o
torah = ['Введение', 'Бытие', 'Исход', 'Левит', 'Числа', 'Второзаконие']
logobject torah
@a1ip
a1ip / README.md
Last active August 29, 2015 14:02
Ruby warrior solution beginner level 1

Level Score: 0
Time Bonus: 8
Clear Bonus: 2
Total Score: 10

module RubyWarrior::Units
class Warrior < Base
def max_health
1000
end
end
end
class Player
def play_turn(warrior)
@a1ip
a1ip / README.md
Last active August 29, 2015 14:02
Ruby warrior solution beginner level 2

Level Score: 12
Time Bonus: 10
Clear Bonus: 4
Total Score: 10 + 26 = 36

@a1ip
a1ip / README.md
Created June 17, 2014 19:53
Ruby warrior solution beginner level 3

Level Score: 48
Time Bonus: 9
Clear Bonus: 11
Total Score: 36 + 68 = 104