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
testruby.bundle: testruby.cr | |
crystal testruby.cr --link-flags "-dynamic -bundle -Wl,-undefined,dynamic_lookup" -o testruby.bundle | |
irb: testruby.bundle | |
irb -rtestruby -I. | |
clean: | |
rm -rf .crystal testruby.bundle |
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 'rom-sql' | |
setup = ROM.setup('postgres://localhost/rom') | |
setup.default.adapter.connection.drop_table?(:users) | |
setup.default.adapter.connection.drop_table?(:groups) | |
setup.default.adapter.connection.create_table :groups do | |
Integer :id | |
String :name, null: false |
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
# further information: | |
# * http://stackoverflow.com/questions/11114349/how-to-visualize-descriptor-matching-using-opencv-module-in-python | |
# * http://docs.opencv.org/doc/tutorials/features2d/feature_homography/feature_homography.html#feature-homography | |
# * http://stackoverflow.com/questions/9539473/opencv-orb-not-finding-matches-once-rotation-scale-invariances-are-introduced | |
# * OpenCV 2 Computer Vision Application Programming Cookbook, Chapter 9 | |
import cv2 | |
import scipy as sp | |
import numpy as np | |
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
* rom (ruby-object-mapper) | |
* rohm | |
* rome (easier to pronounce) | |
* resistance | |
* bloom | |
* allure | |
* agrabla (esperanto) agreeable, enjoyable, lovely, nice, pleasant | |
* vigor (power, energy) | |
* moxie (courage) | |
* "mowr" (pronounced "mower", meaning nothing i can think of, except: "mapping objects with ruby") |
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 CreateUser < Context | |
def initialize(attributes) | |
@attributes = attributes | |
end | |
def self.call(*args) | |
new(*args).tap(&:call) | |
end | |
def callback(*args) |
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 'minitest/autorun' | |
module MiniTest::Assertions | |
def assert_changes(obj, method, exp_diff) | |
before = obj.send method | |
yield | |
after = obj.send method | |
diff = after - before | |
assert_equal exp_diff, diff, "Expected #{obj.class.name}##{method} to change by #{exp_diff}, changed by #{diff}" |
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 [ $# -eq 1 ] | |
then | |
VEID=$1 | |
echo -n "space...: " | |
USAGE=$(grep -A2 "103" /proc/vz/vzquota|sed -n '2,2p'|awk '{print $2}') | |
SOFTLIMIT=$(grep -A2 "103" /proc/vz/vzquota|sed -n '2,2p'|awk '{print $3}') | |
HARDLIMIT=$(grep -A2 "103" /proc/vz/vzquota|sed -n '2,2p'|awk '{print $4}') |
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
RUBY_HEAP_MIN_SLOTS=500000 | |
RUBY_HEAP_SLOTS_INCREMENT=250000 | |
RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
RUBY_GC_MALLOC_LIMIT=50000000 |
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
RUBY_HEAP_MIN_SLOTS=600000 | |
RUBY_GC_MALLOC_LIMIT=59000000 | |
RUBY_HEAP_FREE_MIN=100000 |