This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'set' | |
file = File.new("data") | |
storage = Hash.new {} | |
file.each_line do |line| | |
date, key, value = line.split(';') | |
storage[date][key] = value | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias last_change='git diff $(git status | sed -ne "/Changed/,/Untrack/ p" | grep modified | cut -d: -f2 | head -1)' | |
alias add_last_change='git add $(git status | sed -ne "/Changed/,/Untrack/ p" | grep modified | cut -d: -f2 | head -1)' | |
alias edit_last_change='$EDITOR $(git status | sed -ne "/Changed/,/Untrack/ p" | grep modified | cut -d: -f2 | head -1)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(start-process "ls" nil "ls") | |
(defun keep-output (process output) | |
(setq kept (cons output kept))) | |
(setq kept nil) | |
(set-process-filter (get-process "ls") 'keep-output) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Server | |
def parse_command | |
line = $stdin.readline.chomp | |
command, arguments = line.split(' ', 2) | |
if commands.include?(command) | |
self.send(command, arguments) | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun next-same-indentation () | |
(interactive) | |
(let ((target-indentation (current-indentation))) | |
(while (progn | |
(next-line) | |
(/= target-indentation (current-indentation)))))) | |
(defun previous-same-indentation () | |
(interactive) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.List | |
import Data.Map | |
import System.Environment | |
import Control.Monad | |
import System.IO | |
-- returns triagrams for given string | |
splitIntoTrigrams :: String -> [String] | |
splitIntoTrigrams (a : b : c : ls) = (a : b : c : []) : splitIntoTrigrams (b : c : ls) | |
splitIntoTrigrams (b : c : []) = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def triads() | |
string = self.clone | |
Enumerator.new do |y| | |
while string.size > 2 | |
y << string.slice(0, 3) | |
string.slice!(0) | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'strscan' | |
# single pass converter semi-automatic converter from erb to dust | |
input_stream = $stdin.read | |
# Class to parse ruby line and detect its type, filling symbol table | |
# with references. | |
class RubyLine | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* schema *) | |
module type Schema = sig | |
type t | |
end | |
module Schema = struct | |
type t | |
type value_type = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am zarkzork on github. | |
* I am zarkzork (https://keybase.io/zarkzork) on keybase. | |
* I have a public key whose fingerprint is 5E00 F5A2 F97F 8682 856C 8800 9D18 BF0C 7B3B FBE2 | |
To claim this, I am signing this object: |
OlderNewer