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
Hurjassa nuoruudessaan Susikoira Roi oli viinatrokarina Argentiinan arolla. Kovana panomiehenä Roi nautti tummien ja tulisten argentiinalaisnaisten suloista, mutta oudoksui näiden myötäsyntyistä karvaisuutta. Niinpä vielä vuosien perästä paikalliset naiset muistelivat: "Harva pimpan parturoi niin kuin pampan Pirtu-Roi..." |
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
/** | |
* Checks if timestamp falls into a time period represented as a string | |
* | |
* String has the following options for format: | |
* - "1-7,00:00-23:59" means from mondays (1) to sundays (7) | |
* - "1,00:00-23:59" means that every monday | |
* | |
* | |
* @param ts Date | |
* @param period String |
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> |
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
/* | |
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
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
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 "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 Context | |
attr_accessor :foo | |
attr_accessor :bar | |
def to_s | |
"[Context: foo: #{foo}, bar: #{bar}]" | |
end | |
end |
OlderNewer