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
@font-face { | |
font-family: 'HPBold'; | |
src: url("<%= ('http://myproductionhostorsomething.com/font/HPSimplifiedW04-Bold.eot') %>"); | |
font-weight: normal; | |
font-style: normal; | |
} |
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
# By Oto Brglez - <oto.brglez@opalab.com> | |
require 'httparty' | |
class PeerIndex | |
include HTTParty | |
format :json | |
base_uri "http://api.peerindex.net/v2" | |
def get(handler) |
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
guard 'livereload', :apply_css_live => false, :apply_js_live => false do | |
watch(%r{app/.+\.(erb|haml|js|css|scss)}) | |
watch(%r{app/helpers/.+\.rb}) | |
watch(%r{(public/|app/assets).+\.(css|js|erb|html)}) | |
watch(%r{(app/assets/.+\.css)\.s[ac]ss}) { |m| m[1] } | |
watch(%r{(app/assets/.+\.js)\.coffee}) { |m| m[1] } | |
watch(%r{(app/assets/.+\.js)\.erb}) { |m| m[1] } | |
watch(%r{config/locales/.+\.yml}) | |
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
# By Oto Brglez - <oto.brglez@opalab.com> | |
# Read: | |
# http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-tools/index.html | |
# http://opennlp.apache.org/documentation/1.5.2-incubating/manual/opennlp.html#tools.sentdetect.detection | |
require 'bundler/setup' | |
require 'ruby-debug' | |
require 'pp' |
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
# You have coordinate in array and you want to calculate coordiante that is away from it by length_degree and direction_degree | |
def move point, length_degree=10, direction_degree=0 | |
[ | |
point[0]+length_degree*Math.cos(direction_degree*Math::PI/180), | |
point[1]+length_degree*Math.sin(direction_degree*Math::PI/180) | |
] | |
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
class Hash | |
# This is monkey patch to convert keys to symbols. | |
def keys_to_symbols! | |
self.keys.inject({}) { |i,k| | |
i.merge!({k.to_sym => self.values_at(k).first}) } | |
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
[cs] | |
path = /home/zver/cs | |
public = yes | |
writable = yes | |
printable = no | |
guest ok = yes | |
create mask = 0644 | |
directory mask = 0755 | |
force create mode = 0644 | |
force directory mode = 0755 |
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/spec' | |
require 'minitest/autorun' | |
# Simulating existing structure | |
module Animal | |
def self.included who | |
who.extend ClassMethods | |
end | |
module ClassMethods |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
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
*[master][~/opalab/citysocialize_api]$ rake db:seed rvm:ruby-1.9.3-p194@citysocialize_api | |
rake aborted! | |
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B | |
/Users/otobrglez/.rvm/gems/ruby-1.9.3-p194@citysocialize_api/gems/recurly-2.1.5/lib/recurly/api/net_http_adapter.rb:72:in `request' | |
/Users/otobrglez/.rvm/gems/ruby-1.9.3-p194@citysocialize_api/gems/recurly-2.1.5/lib/recurly/api.rb:50:in `get' | |
/Users/otobrglez/.rvm/gems/ruby-1.9.3-p194@citysocialize_api/gems/recurly-2.1.5/lib/recurly/resource.rb:319:in `find' | |
/Users/otobrglez/opalab/citysocialize_api/app/models/plan.rb:39:in `recurly_plan' | |
/Users/otobrglez/opalab/citysocialize_api/app/models/plan.rb:21:in `update_from_recurly' | |
/Users/otobrglez/.rvm/gems/ruby-1.9.3-p194@citysocialize_api/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:418:in `_run__443529181208233123__save__306707287606003360__callbacks' | |
/Users/otobrglez/.rvm/gems/ruby-1.9.3-p194@cit |