Skip to content

Instantly share code, notes, and snippets.

View dariushoule's full-sized avatar

Darius Houle dariushoule

View GitHub Profile
@dariushoule
dariushoule / spoder-challenge.txt
Created June 30, 2016 20:40
spoder stream cipher 1.0 challenge
This file has been truncated, but you can view the full file.
(spoderman) (spoderman) (mrio) (spoderman) (spoderman) (spoderman) (mrio) (spoderman) (mrio) (mrio) (spoderman) (mrio) (mrio) (mrio) (mrio) (mrio) (spoderman) (spoderman) (spoderman) (mrio) (spoderman) (mrio) (mrio) (spoderman) (mrio) (spoderman) (spoderman) (spoderman) (spoderman) (spoderman) (mrio) (spoderman) (mrio) (spoderman) (spoderman) (mrio) (mrio) (mrio) (mrio) (mrio) (spoderman) (spoderman) (spoderman) (mrio) (spoderman) (mrio) (mrio) (spoderman) (spoderman) (mrio) (spoderman) (mrio) (mrio) (spoderman) (mrio) (spoderman) (spoderman) (spoderman) (mrio) (mrio) (spoderman) (mrio) (mrio) (spoderman) (mrio) (spoderman) (mrio) (mrio) (mrio) (mrio) (mrio) (mrio) (spoderman) (mrio) (mrio) (mrio) (mrio) (mrio) (mrio) (mrio) (mrio) (mrio) (spoderman) (spoderman) (mrio) (spoderman) (mrio) (mrio) (spoderman) (mrio) (mrio) (mrio) (spoderman) (mrio) (mrio) (mrio) (mrio) (mrio) (spoderman) (spoderman) (mrio) (mrio) (mrio) (mrio) (mrio) (mrio) (spoderman) (spoderman) (spoderman) (mrio) (spoderman) (spoderman) (spod
@dariushoule
dariushoule / pseudo_enc_bigint.sql
Created April 11, 2016 21:07
bigint feistel pseudo encrypt
CREATE OR REPLACE FUNCTION pseudo_encrypt(VALUE bigint) returns bigint AS $$
DECLARE
l1 bigint;
l2 bigint;
r1 bigint;
r2 bigint;
i int:=0;
BEGIN
l1:= (VALUE >> 32) & 4294967295::bigint;
r1:= VALUE & 4294967295;
@dariushoule
dariushoule / googlespinner.js
Created January 14, 2016 18:21
googlespinner
var s=document.createElement("style"),css="@keyframes spin {0% {transform: rotate(0deg);} 100% {transform: rotate(360deg);}}";s.type="text/css",s.styleSheet?s.styleSheet.cssText=css:s.appendChild(document.createTextNode(css)),document.body.appendChild(s),document.getElementById("hplogo").setAttribute("style","@keyframes spin {0% {transform: rotate(0deg);} 100% {transform: rotate(360deg);}};animation: spin 1s infinite linear;");
@dariushoule
dariushoule / emb.js
Created September 15, 2015 16:37
Ember obj example
// --- Controller
App.ApolloExampleController = Ember.ObjectController.extend({
exampleRender: []
});
// --- Helper, example of something that could happen on click
viewCtx.controller.set('exampleRender', [
{"a": "this is a1!", "b": "this is b1!"},
$nowUtc = new \DateTime('now', new \DateTimeZone( 'UTC' ));
$nowUtc->setTimezone( new \DateTimeZone('Australia/Sydney'));
echo $nowUtc->format('Y-m-d h:i:s');
@dariushoule
dariushoule / st.txt
Created March 2, 2015 18:11
License transformer date issues
Error: no implicit conversion of nil into String (TypeError)
Backtrace: /Library/Ruby/Gems/2.0.0/gems/openc-json_schema-0.0.9/lib/openc/json_schema/date_converter.rb:37:in `strptime'
/Library/Ruby/Gems/2.0.0/gems/openc-json_schema-0.0.9/lib/openc/json_schema/date_converter.rb:37:in `_convert_dates'
/Library/Ruby/Gems/2.0.0/gems/openc-json_schema-0.0.9/lib/openc/json_schema/date_converter.rb:28:in `block in _convert_dates'
/Library/Ruby/Gems/2.0.0/gems/openc-json_schema-0.0.9/lib/openc/json_schema/date_converter.rb:23:in `each'
/Library/Ruby/Gems/2.0.0/gems/openc-json_schema-0.0.9/lib/openc/json_schema/date_converter.rb:23:in `map'
/Library/Ruby/Gems/2.0.0/gems/openc-json_schema-0.0.9/lib/openc/json_schema/date_converter.rb:23:in `_convert_dates'
/Library/Ruby/Gems/2.0.0/gems/openc-json_schema-0.0.9/lib/openc/json_schema/date_converter.rb:9:in `convert_dates'
/Library/Ruby/Gems/2.
@dariushoule
dariushoule / stripe_semicolon
Last active August 29, 2015 14:15 — forked from boucher/gist:1750368
Stripe demo w/ semicolon added.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Sample Form</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<script type="text/javascript">
@dariushoule
dariushoule / order_place.swift
Last active August 29, 2015 14:14
Tangocard API example code in Swift, ordering a $15.00 Amazon card
func placeOrder() {
// Platform and account information
let platform = "<platform>"
let key = "<key>"
let customer = "<customer>"
let account_identifier = "<account>"
// Prepare basic auth
let loginString = NSString(format: "%@:%@", platform, key)
@dariushoule
dariushoule / mysql_aes_decrypt
Created February 2, 2015 00:02
mysql_aes_encrypt/mysql_aes_decrypt
//This works completely with mysql aes, even long keys.
<?php
function mysql_aes_decrypt($val,$ky)
{
$key="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
for($a=0;$a<strlen($ky);$a++)
$key[$a%16]=chr(ord($key[$a%16]) ^ ord($ky[$a]));
$mode = MCRYPT_MODE_ECB;
$enc = MCRYPT_RIJNDAEL_128;
@dariushoule
dariushoule / csa_bot_out_snippet
Created December 18, 2014 00:19
Ouput format
{"firm": "1832 ASSET MANAGEMENT L.P./GESTION D'ACTIFS 1832 S.E.C.", "sample_date": "2014-12-17T16:10:01.956343", "jurisdiction": "Alberta, British Columbia, Manitoba, New Brunswick, Newfoundland and Labrador, Northwest Territories, Nova Scotia, Ontario, Prince Edward Island, Qu\u00e9bec, Saskatchewan, Yukon", "locations": [{"category": "Portfolio Manager", "status": "Active", "from": "September 28, 2009", "contact": "Head Office\n1 Adelaide Street East\nSuite 2700\nToronto ON M5C 2V9\nPhone: 416-933-1937", "location_name": "Alberta", "contact_name": "Head Office"}, {"category": "Portfolio Manager", "status": "Active", "from": "September 28, 2009", "contact": "Head Office\n1 Adelaide Street East\nSuite 2700\nToronto ON M5C 2V9\nPhone: 416-933-1937", "location_name": "British Columbia", "contact_name": "Head Office"}, {"category": "Portfolio Manager", "status": "Active", "from": "September 28, 2009", "contact": "Head Office\n1 Adelaide Street East\nSuite 2700\nToronto ON M5C 2V9\nPhone: 416-933-1937"