Skip to content

Instantly share code, notes, and snippets.

Kristofer Krause dragthor

View GitHub Profile
@dragthor
dragthor / optionspread.js
Created Oct 1, 2019
option spread calculation
View optionspread.js
var calc = function (itm_percent, credit_received, spread_with, multiplier) {
var win = 0;
var lose = 0;
for (var m = 0; m < multiplier; m++) {
for (var i = 0; i < 100; i++) {
// 0 -> 99
var r = Math.floor(Math.random() * 100);
if (r < itm_percent) win++;
View foundation.blink.js
@dragthor
dragthor / Zurb6-pricingtable.md
Created May 6, 2016
Zurb 6 Pricing Table Doc Markdown
View Zurb6-pricingtable.md
@dragthor
dragthor / zurb6-pricingtable.scss
Last active May 23, 2016
Zurb 6 Pricing Table SCSS
View zurb6-pricingtable.scss
/* http://metroize.com/zurb/ */
$gainsboro: #DDD;
$oil: #333;
$smoke:#F6F6F6;
$monsoon: #777;
// We use this to control the border color
$price-table-border: solid 1px $gainsboro;
View zurb6-pricingtable.htm
<!-- http://metroize.com/zurb/ -->
<ul class="pricing-table">
<li class="title">Standard</li>
<li class="price">$99.99</li>
<li class="description">An awesome description</li>
<li class="bullet-item">1 Database</li>
<li class="bullet-item">5GB Storage</li>
<li class="bullet-item">20 Users</li>
<li class="cta-button"><a class="button" href="#">Buy Now</a></li>
</ul>
View Zurb Plugin HTML
<div data-datepicker data-open="dateTimeModal">
<input type="text" value="04/20/2016" />
<div class="reveal" id="dateTimeModal" data-reveal>
<div class="row">
<div class="small-12 medium-4 columns">
<label>Month:
<select class="datepicker-month"></select>
</label>
View Zurb Plugin
'use strict';
!function($) {
class MyZurbPlugin {
/**
* Creates a new instance of an myzurbplugin.
* @class
* @fires MyZurbPlugin#init
* @param {jQuery} element - jQuery object to make into an myzurbplugin.
View zurb test shell file
describe('reveal:', function() {
beforeEach(function() {
this.addMatchers({
// Place reveal-specific matchers here...
});
var origFunc = $.fn.foundation;
spyOn($.fn, 'foundation').andCallFake(function() {
var result = origFunc.apply(this, arguments);
jasmine.Clock.tick(1000); // Let things settle...
View gist:8e668ef1789186516884
private async void Image_PointerPressed(object sender, PointerRoutedEventArgs e)
{
var img = e.OriginalSource as Windows.UI.Xaml.Controls.Image;
if (img == null) return;
var title = img.Tag as string;
// The object for controlling the speech-synthesis engine (voice).
var synth = new Windows.Media.SpeechSynthesis.SpeechSynthesizer();
View gist:3cccf7e82838f07b1f22
private void Image_PointerPressed(object sender, PointerRoutedEventArgs e)
{
var img = e.OriginalSource as Windows.UI.Xaml.Controls.Image;
if (img == null) return;
var title = img.Tag as string;
// The object for controlling the speech-synthesis engine (voice).
var synth = new Windows.Media.SpeechSynthesis.SpeechSynthesizer();
You can’t perform that action at this time.