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
(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 |
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
#!/bin/sh | |
if [[ $(git diff | grep "binding.pry" | wc -l) -gt 0 ]]; then | |
echo "Remove binding.pry" && exit 1 | |
fi |
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
defmodule GreekStemmer do | |
@alphabet ~r/^[ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ]+$/i | |
def protected_words do | |
end | |
def exceptions do | |
end | |
def process(regex, word) do |
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
cond do | |
Regex.run(~r/^(.+?)(ΑΔΕΣ|ΑΔΩΝ)$/u, word) -> | |
# do stuff here | |
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
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)) |
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
-- 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", |
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
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 |
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
#!/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}" |
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
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 |
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
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?"); |