Skip to content

Instantly share code, notes, and snippets.

View avgerin0s's full-sized avatar

Aggelos Avgerinos avgerin0s

  • Skroutz S.A.
  • Athens, Greece
View GitHub Profile
use core::io::println;
/* Ask the user for their name */
fn ask_name(prompt: ~str) -> ~str {
println(prompt);
return io::stdin().read_line();
}
fn main() {
let name = ask_name(~"What is your name?");
tableFor "posts", (t) ->
t.head ->
t.row ->
t.cell "title", sort: true
t.cell "body", sort: true
t.cell()
t.cell()
t.cell()
t.body ->
for post in @posts
#!/home/agorf/.rbenv/shims/ruby
require 'json'
workspaces = JSON.load(`i3-msg -t get_workspaces`)
num = ((1..10).to_a - workspaces.map {|w| w['num'] }).min
exec "i3-msg workspace #{num}"
module FuzzyMatch
def self.equals?(obj1, obj2)
if obj1.is_a?(Array) && obj2.is_a?(Array)
obj1.sort == obj2.sort
elsif obj1.is_a?(Hash) && obj2.is_a?(Hash)
return false if !equals?(obj1.keys, obj2.keys)
obj1.keys.each do |key|
return false if !equals?(obj1[key], obj2[key])
end
-- xmobar config used by Vic Fryzel
-- Author: Vic Fryzel
-- http://github.com/vicfryzel/xmonad-config
-- This is setup for dual 1920x1080 monitors, with the right monitor as primary
Config {
-- position = TopW C 80,
position = Static { xpos = 0 , ypos = 0, width = 1806, height = 16 },
-- border = BottomB,
borderColor = "grey",
function y = circonvt(x1,x2,N)
% N-������� ������� �������� ������ ��� x1 & x2: (��� ����� ��� ������)
% ---------------------------------------------------------------------
% [y] = circonvt(x1,x2,N)
% y = ��������� ��� �������� ��� ������� ��������
% x1 = ��������� ������� �� ����� N1 <= N
% x2 = ��������� ������� �� ����� N2 <= N
% N = ����� �������� ���������
% �������: y(n) = sum (x1(m)*x2((n-m) mod N))
cond do
Regex.run(~r/^(.+?)(ΑΔΕΣ|ΑΔΩΝ)$/u, word) ->
# do stuff here
end
defmodule GreekStemmer do
@alphabet ~r/^[ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ]+$/i
def protected_words do
end
def exceptions do
end
def process(regex, word) do
#!/bin/sh
if [[ $(git diff | grep "binding.pry" | wc -l) -gt 0 ]]; then
echo "Remove binding.pry" && exit 1
fi
(ns redis-example.core
(:require [taoensso.carmine :as redis :refer (wcar)]))
(defmacro wcar* [& body] `(redis/wcar server-connection ~@body))
(defn init-redis []
(def server-connection {:pool {:max-active 1}
:spec {
:host "localhost"
:port 6379