Skip to content

Instantly share code, notes, and snippets.

View hiyosi's full-sized avatar

Tomoya Usami hiyosi

View GitHub Profile

OmniAuth::OpenIDConnect

OpenID Connect strategy for OmniAuth Gem Version Build Status Coverage Status Code Climate

Installation

[Tag] json:name, ham:true, spam:false
[Value] eggs
[Tag] json:version, ham:false, spam:true
[Value] 1
package main
import (
"fmt"
"reflect"
)
type Meta struct {
Name string `json:"name" ham:"true" spam:"false"`
Version string `json:"version" ham:"false" spam:"true"`
@hiyosi
hiyosi / gist:6c938daac77ca217ac69
Created October 13, 2014 11:29
scim2.0 core schema draft-11
{[
{
"id" : "urn:ietf:params:scim:schemas:core:2.0:User",
"name" : "User",
"description" : "User Account",
"attributes" : [
{
"name" : "userName",
"type" : "string",
"multiValued" : false,
class Hoge
def self.hoge
obj = Kernel.const_get(klass.capitalize).new
attributes.each do |key|
obj.send("#{key}=", key.to_s + "!!!")
end
p obj
end
def self.klass
require 'mqtt'
host = '127.0.0.1'
port = 61613
MQTT::Client.connect(:remote_host => host, :remote_port => port,
:username => 'admin', :password => 'password') do |client|
client.get('tutorial') do |topic,message|
require 'mqtt'
host = '127.0.0.1'
port = 61613
MQTT::Client.connect(:remote_host => host, :remote_port => port,
:username => 'admin', :password => 'password') do |client|
client.publish('tutorial', 'Hello, Apollo', retain=true)
def pascalsTraiangle(col: Int, row: Int): Int = {
if(col == 0 ){
1
}else if (col == row){
1
}else
pascalsTraiangle((col - 1),(row - 1)) + pascalsTraiangle(col, (row - 1))
}
(defroute task-show ("/tasks/:id" :method :GET) (&key id)
"指定されたIDのJSONを返却します。存在しない場合はHTTPステータスコード404を返却します。"
(let ((task (find-task-from-db (parse-integer id))))
(if (eq task nil)
(progn
(setf (status *response*) 404)
"")
(render-json task))))
(defun find-task-from-db (id)