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
$ rvm use ruby-1.9.3-p362 | |
Using /Users/me/.rvm/gems/ruby-1.9.3-p362 | |
$ irb | |
1.9.3p362 :001 > require 'strscan' | |
=> true | |
1.9.3p362 :002 > scanner = StringScanner.new('cölorfül') | |
=> #<StringScanner 0/10 @ "c\xC3\xB6lo..."> | |
1.9.3p362 :003 > scanner.pos = 9 | |
=> 9 | |
1.9.3p362 :004 > scanner |
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
--- | |
- hosts: all | |
remote_user: root | |
vars: | |
user: '{{ lookup("env", "USER") }}' | |
tasks: | |
- name: python apt |
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
FROM ubuntu:latest | |
MAINTAINER Alexey Niktin <niktin@corp.sputnik.ru> | |
# RUN echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" > /etc/apt/sources.list | |
ADD provisioning.sh /tmp/provisioning.sh | |
RUN bash /tmp/provisioning.sh | |
EXPOSE 22 |
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
# Include dependencies declared by lenskit-package to ensure we load all lenskit JAR files | |
# Reference: http://mvnrepository.com/artifact/org.grouplens.lenskit/lenskit-package/2.0 | |
jar 'org.grouplens.lenskit:lenskit-core' | |
jar 'org.grouplens.lenskit:lenskit-eval' | |
jar 'org.grouplens.lenskit:lenskit-knn' | |
jar 'org.grouplens.lenskit:lenskit-slopeone' | |
jar 'org.grouplens.lenskit:lenskit-svd' |
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
%define rubyver_major 2 | |
%define rubyver_minor 1 | |
%define rubyver_patch 6 | |
%define rubyver %{rubyver_major}.%{rubyver_minor}.%{rubyver_patch} | |
%define ruby_archive ruby-%{rubyver} | |
%define prefix /opt/%{ruby_archive} | |
Summary: An interpreter of object-oriented scripting language | |
Name: ruby | |
Version: %{rubyver} |
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(cozy_lists). | |
-include_lib("eunit/include/eunit.hrl"). | |
-export ([ | |
even/1, | |
odd/1, | |
uniq/1, | |
find_index/2, | |
count/2, | |
all_sublists/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
#!/usr/bin/env ruby | |
require 'pp' | |
require 'continuation' | |
def map_tree(tree, &proc) | |
if tree.is_a? Array | |
tree.map { |node| map_tree(node, &proc) } | |
else | |
proc[tree] |
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 Synchronizer | |
module ClassMethods | |
attr_reader :m, :cv | |
def init! | |
@m = Mutex.new | |
@cv = ConditionVariable.new | |
end | |
def wait |
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
if [ -z "$1" ]; then | |
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4 | |
else | |
shot_path="$*" | |
fi | |
ffmpeg="ffmpeg" | |
n6_frame="n6-background.png" | |
trap ctrl_c INT |
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 spark.Spark.* | |
import java.sql.Connection | |
import java.sql.DriverManager | |
import java.sql.ResultSet | |
fun initDb(connection: Connection) { | |
connection.createStatement().execute(""" | |
CREATE TABLE adjectives( | |
id INT AUTO_INCREMENT PRIMARY KEY, |
OlderNewer