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
root@testipannu-1:/data/data/profiles/test-246401d041c711e69af6970683addfb4# ls -l | |
total 36 | |
drwxr-xr-x 2 root root 6 Jul 4 09:10 backups | |
-rw-r--r-- 1 root root 43 Jul 4 09:28 la-1-big-CompressionInfo.db | |
-rw-r--r-- 1 root root 266 Jul 4 09:28 la-1-big-Data.db | |
-rw-r--r-- 1 root root 10 Jul 4 09:28 la-1-big-Digest.adler32 |
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
CREATE TABLE test ( | |
office text, | |
office_team text, | |
ts timestamp, | |
team_member text, | |
action text, | |
is_team_active boolean static, | |
PRIMARY KEY ((office, office_team), ts, team_member) | |
); |
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 Context | |
attr_accessor :foo | |
attr_accessor :bar | |
def to_s | |
"[Context: foo: #{foo}, bar: #{bar}]" | |
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
require "pp" | |
require "sinatra/base" | |
# A blank Sinatra app | |
class SinatraApp < Sinatra::Base | |
configure do | |
set :server, :puma | |
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
class SinatraApp < Sinatra::Base | |
get '/test' do | |
"This works\n" | |
end | |
end | |
app = SinatraApp.new | |
# How to create a new routes into the app now? I would like to do something like this: | |
app.get "/hello" do |
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 'sinatra/base' | |
require 'puma' | |
require 'rack' | |
require 'rack/server' | |
# Our simple hello-world app | |
class HelloApp < Sinatra::Base | |
configure do | |
set :server, :puma |
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 <iostream> | |
template <unsigned N> | |
struct Fibonacci | |
{ | |
enum | |
{ | |
value = Fibonacci<N-1>::value + Fibonacci<N-2>::value | |
}; |
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
/* | |
Send a Start/Sop Recording command to the LANC port of a video camera. | |
Tested with a Canon XF300 camcorder | |
This code requires a simple interface see http://micro.arocholl.com | |
Feel free to use this code in any way you want. | |
Comprehensive LANC info: www.boehmel.de/lanc.htm | |
"LANC" is a registered trademark of SONY. | |
CANON calls their LANC compatible port "REMOTE". |
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
credentials = data_bag_item "credentials", "aws" | |
aws_ebs_volume device do | |
aws_access_key credentials["aws_access_key_id"] | |
aws_secret_access_key credentials["aws_secret_access_key"] | |
device device | |
action [ :create, :attach ] | |
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
ruby_block "test" do | |
block do | |
# prints [:find_snapshot_id, :ec2, :instance_id, :instance_availability_zone] | |
Chef::Log.info("Opscode::Aws::Ec2.instance_methods(false) #{Opscode::Aws::Ec2.instance_methods(false)}") | |
# This throws "undefined method `ec2' for Opscode::Aws::Ec2:Module" | |
Chef::Log.info("ec2: #{Opscode::Aws::Ec2.ec2}") | |
# This throws undefined local variable or method `new_resource' for #<Object:0x0000000293b0a0> |