Skip to content

Instantly share code, notes, and snippets.

View IrakliJani's full-sized avatar
🇬🇪

Irakli Janiashvili IrakliJani

🇬🇪
View GitHub Profile
@IrakliJani
IrakliJani / gist:4413023
Created December 30, 2012 14:23
RailsCasts colors for GitGutter in Sublime Text
<dict>
<key>name</key>
<string>diff.deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#DA4939</string>
</dict>
@IrakliJani
IrakliJani / mapreduce1.js
Created January 2, 2013 18:42
MongoDB simple mapReduce (counts chars in a wordlist) (ugly version)
map = function(){
chars = this.word.split("");
length = chars.length;
result = {};
for(var i = 0; i < length; ++i){
if(! result[chars[i]]) result[chars[i]] = 0;
result[chars[i]] += 1;
}
@IrakliJani
IrakliJani / mapreduce2.js
Created January 2, 2013 18:44
MongoDB simple mapReduce (counts chars in a wordlist)
map = function(){
word = this.word.split("");
chars = {};
for(var i in word)
if(! chars[word[i]])
chars[word[i]] = 1;
else
chars[word[i]]++;
@IrakliJani
IrakliJani / fib.rb
Last active December 10, 2015 18:29
Fibonacci number in ruby using ruby's default hash value
fib = Hash.new do |hash, key|
if [0, 1].include? key
hash[key] = key
else
hash[key] = hash[key - 1] + hash[key - 2]
end
end
fib[123]
=> 22698374052006863956975682
@IrakliJani
IrakliJani / hacker
Created May 10, 2014 09:15
Nodejs.ge request logs
<-- POST /cgi-bin/php?-d allow_url_include=on -d safe_mode=off -d suhosin.simulation=on -d disable_functions="" -d open_basedir=none -d auto_prepend_file=php://input -d cgi.force_redirect=0 -d cgi.redirect_status_env=0 -n
--> POST /cgi-bin/php?-d allow_url_include=on -d safe_mode=off -d suhosin.simulation=on -d disable_functions="" -d open_basedir=none -d auto_prepend_file=php://input -d cgi.force_redirect=0 -d cgi.redirect_status_env=0 -n 404 2ms -
<-- POST /cgi-bin/php5?-d allow_url_include=on -d safe_mode=off -d suhosin.simulation=on -d disable_functions="" -d open_basedir=none -d auto_prepend_file=php://input -d cgi.force_redirect=0 -d cgi.redirect_status_env=0 -n
--> POST /cgi-bin/php5?-d allow_url_include=on -d safe_mode=off -d suhosin.simulation=on -d disable_functions="" -d open_basedir=none -d auto_prepend_file=php://input -d cgi.force_redirect=0 -d cgi.redirect_status_env=0 -n 404 4ms -
<-- POST /cgi-bin/php-cgi?-d allow_url_include=on -d safe_mode=off -d suhosin.simulation=on -d disable_f
@IrakliJani
IrakliJani / hacker2
Created May 10, 2014 09:54
Nodejs.ge request logs 2
<-- GET /HNAP1/
--> GET /HNAP1/ 404 4ms -
<-- GET /wp-admin/install.php
--> GET /wp-admin/install.php 404 2ms -
<-- GET /invoker/JMXInvokerServlet
--> GET /invoker/JMXInvokerServlet 404 2ms -
@IrakliJani
IrakliJani / kata-day1.js
Created May 10, 2014 17:52
Kata solution for Node.js georgian community - Day 1
// http://www.codewars.com/kata/521c2db8ddc89b9b7a0000c1/train/javascript
snail = function (array) {
var snake = [];
while (true) {
snake.push.apply(snake, array.shift());
if (array.length === 0) break;
array = rotate_left(array);
}
@IrakliJani
IrakliJani / kata-day2.js
Created May 11, 2014 07:23
Kata solution for Node.js group Georgia
function count (string) {
return string.split('').reduce(function (w, c) { return (w[c] ? w[c]++ : w[c] = 1) && w; }, {});
}
@IrakliJani
IrakliJani / kata-day1.rb
Created May 11, 2014 08:12
Kata solution for Ruby user group georgia
def count str
str.split('').reduce(Hash.new 0) { |memo, c| memo[c] += 1; memo }
end
span {
color: #6EACFF;
animation: hue-rotate 60s linear infinite;
}
@keyframes hue-rotate {
from {
.hue-rotate();
}
to {