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 'csv' | |
head = <<-HEAD | |
<?xml version="1.0" encoding="UTF-8" standalone="true"?> | |
<data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
HEAD | |
foot = <<-FOOT | |
</data-set> | |
FOOT |
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 MyStrings | |
def dash_heredoc | |
<<-HEREDOC | |
This is a multiline string in Ruby using the older indented syntax. | |
These lines will have a bunch of leading whitespace. | |
HEREDOC | |
end | |
def squiggly_heredoc | |
<<~HEREDOC |
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 'logger' | |
require 'net/http' | |
require 'json' | |
require 'mail' # gem 'mail' | |
dir = File.dirname(__FILE__) | |
logger = Logger.new(File.join(dir, "log.txt")) | |
logger.level = Logger::INFO |
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 | |
### BEGIN INIT INFO | |
# Provides: btsync | |
# Required-Start: $network $remote_fs $syslog | |
# Required-Stop: $network $remote_fs $syslog | |
# Should-Start: network-manager | |
# Should-Stop: network-manager | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
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 "rubygems" | |
require "gems" | |
require "json" | |
require "retryable" | |
gems = [] | |
File.open("gems", "r") do |f| | |
while (l = f.gets) do | |
gems << l.strip() | |
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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'pp' | |
require 'benchmark' | |
Pleading = Struct.new(:no, :position ,:person, :party, :replik, :content, :point) | |
Point = Struct.new(:no, :title) | |
class DocumentParsing | |
POINT_REGEX = /^(?<no>\d+)\s+\§\s+(?<title>.+?)\s?$/ |
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-color bg-grey #222; | |
@define-color active #313131; | |
TerminalWindow .notebook { | |
border: 0; | |
padding: 0; | |
color: #fff; | |
background-color: shade(@active-grey, 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
MyClass = Class.new do | |
def foo | |
"bar" | |
end | |
end | |
MyClass.new.foo | |
#=> "bar" | |
class MyClass2 |
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
a=[1,2,3,4];b=[];a.reject!{|n|b<<n if n.odd?};[a,b] |
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 PhotoFrame | |
constructor: -> | |
@foo = "bar" |