This file contains hidden or 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
CREATE OR REPLACE FUNCTION text_to_json(text text, regex varchar) RETURNS json[] AS $$ | |
DECLARE | |
chunk text; | |
res json[]; | |
BEGIN | |
FOREACH chunk IN array regexp_split_to_array(text, regex) | |
LOOP | |
IF TRIM(chunk) <> '' THEN | |
BEGIN | |
res := res || chunk::json; |
This file contains hidden or 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 TicTacToe | |
def initialize | |
@player1 = Player.new(1, 'X') | |
@player2 = Player.new(2, 'O') | |
@players = [@player1, @player2] | |
@winner = false | |
@board = Board.new | |
end | |
def play |
This file contains hidden or 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
inherit_from: | |
- .rubocop_todo.yml | |
AllCops: | |
TargetRubyVersion: 2.3 | |
Include: | |
- '**/Gemfile' | |
- '**/Rakefile' | |
- '**/config.ru' | |
Exclude: |
This file contains hidden or 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 ruby:2.4.1 | |
RUN apt-get update -qq && apt-get install -y build-essential | |
# for postgres | |
RUN apt-get install -y libpq-dev | |
# for nokogiri | |
RUN apt-get install -y libxml2-dev libxslt1-dev |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd"> | |
<!-- Fri, 24 Feb 2006 Generated from KCHR: "Dvorak" --> | |
<!-- Author: Laura Paredes <[email protected]>--> | |
<!--Last edited by Ukelele version 2.2.8 on 2014-12-21 at 09:58 (CET)--> | |
<keyboard group="0" id="16300" name="Dvorak ES" maxout="1"> | |
<layouts> | |
<layout first="0" last="0" modifiers="commonModifiers" mapSet="ANSI"/> | |
</layouts> | |
<modifierMap id="commonModifiers" defaultIndex="0"> |
This file contains hidden or 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
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
guard 'rspec' do | |
watch(%r{^spec/.+_spec\.rb$}) | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch('spec/spec_helper.rb') { "spec" } | |
# Rails example | |
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } |
This file contains hidden or 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
# This configuration was generated by `rubocop --auto-gen-config` | |
# on 2015-02-23 19:26:33 +0100 using RuboCop version 0.29.1. | |
# The point is for the user to remove these configuration records | |
# one by one as the offenses are removed from the code base. | |
# Note that changes in the inspected code, or installation of new | |
# versions of RuboCop, may require this file to be generated again. | |
# Offense count: 1 | |
Lint/Void: | |
Enabled: false |
This file contains hidden or 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 FoursquarePlace | |
include Cacheable | |
ATTRIBUTES = %i(pid name street city country latitude longitude icon | |
categories) | |
def initialize(attrs = {}) | |
@connection = FoursquareConnector.new | |
_initialize_attributes!(attrs) |
This file contains hidden or 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
$redis = Redis.new(host: 'localhost', port: 6379, db: 1) |
This file contains hidden or 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
var width = 750; | |
var height = 500; | |
var radius = 200; | |
var strokeColor = "#999"; | |
var strokeOpacity = 0.75; | |
var labelMargin = radius + 20; | |
var concentric = []; | |
for(var i = 1; i <= 10; i++) { | |
concentric.push((radius * i) / 10); |
NewerOlder