Skip to content

Instantly share code, notes, and snippets.

-- /usr/local/openresty/bin/resty -e "require 'busted.runner'({ standalone = false })"
local jwt = require 'resty.jwt'
local shared_key_32 = '12341234123412341234123412341234'
local shared_key_64 = '12341234123412341234123412341234' ..
'12341234123412341234123412341234'
describe('jwe', function()
context('encode', function()
context('A128CBC-HS256 Direct Encryption', function()
@saks
saks / designer.html
Created June 27, 2014 07:57
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
A good commit message looks like this:
Header line: explaining the commit in one line
Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc etc.
The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
@saks
saks / gist:1105630
Created July 26, 2011 00:33
Ruby Style Guide
Original Source: https://github.com/chneukirchen/styleguide
= Christian Neukirchen's Ruby Style Guide
You may not like all rules presented here, but they work very well for
me and have helped producing high quality code. Everyone is free to
code however they want, write and follow their own style guides, but
when you contribute to my code, please follow these rules:
@saks
saks / relation.rb
Created June 4, 2011 08:08
strange N..N mongoid relation behavior
require 'mongoid'
Mongoid.configure do |config|
name = "gist_tests"
host = "localhost"
config.master = Mongo::Connection.new.db(name)
config.persist_in_safe_mode = false
end
class Book
@saks
saks / mongoid_unexpected_behavior.rb
Created February 10, 2011 12:07
unexpected behavior of #write_inheritable_attribute with Mongoid::Document included
require 'mongoid'
class A
include Mongoid::Document
write_inheritable_attribute :attr_name, 'attr for A'
class_inheritable_reader :attr_name
end
class B < A; end
@saks
saks / small_test.rb
Created December 14, 2010 23:22
this should work
require 'rubygems'
require 'mongoid'
require 'mongoid_acts_as_tree'
Mongoid.configure do |config|
name = "control_development"
host = "localhost"
config.master = Mongo::Connection.new.db(name)
config.persist_in_safe_mode = false
end
require 'mongoid'
Mongoid.configure do |config|
name = "control_development"
host = "localhost"
config.master = Mongo::Connection.new.db(name)
config.persist_in_safe_mode = false
end
class Site