Skip to content

Instantly share code, notes, and snippets.

View mckoss's full-sized avatar

Mike Koss mckoss

View GitHub Profile
@mckoss
mckoss / designer.html
Created August 8, 2014 20:54
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element" attributes="foo bar">
<template>
<style>
:host {
@mckoss
mckoss / gist:4211704
Created December 5, 2012 02:53
String-based Hierarchical Deterministic Bitcoin Keys

String-based Heirarchical Deterministic Keys

This is an alternate proposal to [BIP32].

Version History:

  • 12-7-2102: Addition of chain code (much as BIP32 uses).
  • 12-3-2012: Initial Proposal (version 1)

Motivation

@mckoss
mckoss / securing_rails_updates.md
Created March 5, 2012 15:14 — forked from peternixey/securing_rails_updates.md
How Homakov hacked GitHub and how to protect your application

##How Homakov hacked GitHub and the line of code that could have prevented it

@homakov’s explot on GitHub was simple and straightforward. Calling it an attack makes it sound malicious whereas the truth was that GitHub bolted its front door but left the hinges on quick release. Homakov released the hinges, walked in and shouted to anyone who would listen that they had a problem.

He was right. The Rails defaults are vulnerable and there’s no better illustration of this than when when one of the best Rails teams in the world is severely compromised.


TL;DR: How to protect your Rails application from the GitHub attack

@mckoss
mckoss / moved.md
Created December 30, 2011 00:28
A Bitcoin Primer
// From http://clients1.google.com/js/counter2_compiled.js
google.eggRequest = function (a) {
var b = document.createElement("SCRIPT");
b.src = "http://clients1.google.com/egg?ei=" + google.kEI + "&cd=" + a;
google.append(b)
}
google.egg ||
function () {
@mckoss
mckoss / DynDict.py
Created December 30, 2009 03:20
DynDict - implement a nested collection of dictionaries
import UserDict
class DynDict(UserDict.DictMixin):
"""
Implement a dynamic dictionary object, which acts as the union of the dictionaries
from which it was created.
The first dictionary is searched first, and subsequent dictionaries are searched when no results are found.
New elements are always created in the first dictionary.
@mckoss
mckoss / simple.html
Created December 8, 2009 18:10
Simple HTML
<html>
<head>
<title>Sample File</title>
</head>
<body>
<h1><script>document.write(document.title></script></h1>
</body>
</html>
@mckoss
mckoss / unit.js
Created December 7, 2009 19:47
JavaScript Unit Testing Framework
// unit.js - Unit testing framework
// Copyright (c) 2007-2009, Mike Koss (mckoss@startpad.org)
//
// Usage:
// ts = new UT.TestSuite("Suite Name");
// ts.DWOutputDiv();
// ts.AddTest("Test Name", function(ut) { ... ut.Assert() ... });
// ...
// ts.Run();
// ts.Report();
@mckoss
mckoss / namespace.js
Created December 7, 2009 19:47
JavaScript Namespace
/* Namespace.js
Version 1.0, June 2009
by Mike Koss - released into the public domain.
Support for building modular namespaces in javascript.
Globals:
window.global_namespace (Namespace) - The top of the namespace heirarchy. Child namespaces
@mckoss
mckoss / enigma-test.html
Created December 7, 2009 19:46
Enigma Machine Simulator with Unit Tests
<html>
<head>
<title>Engima Test Page</title>
<script src="namespace.js"></script>
<script src="enigma.js"></script>
<script src="unit.js"></script>
</head>
<body>
<h1><script>document.write(document.title);</script></h1>
<SCRIPT>