Skip to content

Instantly share code, notes, and snippets.

```sql
CREATE TABLE schema_migrations (
version bigint NOT NULL,
inserted_at timestamp without time zone
);
ALTER TABLE ONLY schema_migrations
def up do
{:ok, sqlqueries} = File.read("priv/repo/migrations/pg_schema.sql")
Enum.map(String.split(sqlqueries, ";"), fn(sqlquery) -> execute(sqlquery) end)
end
@IgorKarymov
IgorKarymov / okta saml
Created October 4, 2013 13:55
okta saml
<saml2p:Response Destination="https://10.10.18.25/saml/consume" ID="id100027984869995841078625485" IssueInstant="2013-10-04T13:52:38.722Z" Version="2.0">
<saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://www.okta.com/kbgfrazyGWKYZDXQCOWI</saml2:Issuer>
<ds:Signature>
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#id100027984869995841078625485">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
@IgorKarymov
IgorKarymov / simplesamlphp
Created October 4, 2013 13:42
simplesamlphp
<samlp:Response ID="pfx56c3177d-f249-e6ad-8130-0d391e959c7f" Version="2.0" IssueInstant="2013-10-04T12:47:49Z" Destination="https://10.10.18.25/saml/consume" InResponseTo="27514362-2cf3-11e3-9269-3c970e5b14dc">
<saml:Issuer>http://192.51.100.21/simplesamlphp/saml2/idp/metadata.php</saml:Issuer>
<ds:Signature>
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#pfx56c3177d-f249-e6ad-8130-0d391e959c7f">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
@IgorKarymov
IgorKarymov / gist:6776658
Created October 1, 2013 10:37
centrify saml response
<saml2p:Response ID="_f7e95f5a-f1f9-41b1-bf91-bb6ce152129b" Version="2.0" IssueInstant="2013-09-27T13:44:30.617Z" Destination="https://login.myapp.com">
<Issuer>https://cloud.centrify.com/SAML/Generic SAML</Issuer>
<Signature>
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#_f7e95f5a-f1f9-41b1-bf91-bb6ce152129b">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
with_worker(Fun) when is_function(Fun, 1) ->
{IsFromDict, Worker} =
case get($riak_pool_worker) of
undefined ->
Worker = riak_pool:get_worker(),
@IgorKarymov
IgorKarymov / gist:1797406
Created February 11, 2012 07:13
validator
Validators = [
{<<"count">>, {integer, [{min, 1}, {optional, 20}]}},
{<<"enabled">>, {boolean, []}}
],
{ok, [Count, Enabled]} =
validator:validate_json(JsonData, Validators, #val_opts{throw = true,
/home/ingham/erls/lib/parsetools-2.0.5/include/leexinc.hrl:49: The pattern <Rest, Line, {'token', T, Push}, Ts> can never match the type <_,_,'error' | 'skip_token',[{atom(),_} | {'atom',_,atom()} | {'integer',_,integer()} | {'module_def',_,'module'} | {'server_def',_,'server'} | {'val',_,[any()]}]>
/home/ingham/erls/lib/parsetools-2.0.5/include/leexinc.hrl:52: The pattern <Rest, Line, {'end_token', T}, Ts> can never match the type <_,_,'error' | 'skip_token',[{atom(),_} | {'atom',_,atom()} | {'integer',_,integer()} | {'module_def',_,'module'} | {'server_def',_,'server'} | {'val',_,[any()]}]>
/home/ingham/erls/lib/parsetools-2.0.5/include/leexinc.hrl:54: The pattern <Rest, Line, {'end_token', T, Push}, Ts> can never match the type <_,_,'error' | 'skip_token',[{atom(),_} | {'atom',_,atom()} | {'integer',_,integer()} | {'module_def',_,'module'} | {'server_def',_,'server'} | {'val',_,[any()]}]>
/home/ingham/erls/lib/parsetools-2.0.5/include/leexinc.hrl:59: The pattern <Rest, Line, {'skip_token', Push}, Ts> can n
(color-theme-tangotango)
(column-number-mode t)
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/src/ac-dict")
(ac-
@IgorKarymov
IgorKarymov / gist:1224897
Created September 18, 2011 09:22
riak if_not_modified
-module(test).
-export([
test/0
]).
-define(RIAK_HOS