View puts the feed ticker on the side bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:$('.sidebar-widget').parent().prepend($('<div class="sidebar-widget"></div>').append($('#feed-ticker')));$('#feed-ticker').attr('style', 'display: block; max-width: 100%; position: relative; overflow-y: scroll;'); |
View someMidiFileJunk.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using: https://raw.githubusercontent.com/nfroidure/MIDIFile/master/dist/MIDIFile.js | |
$('#input-area').prepend('<input type="file" id="someFile" />'); $('#someFile').change(function() { var f = document.getElementById('someFile').files[0]; var fr = new FileReader(); fr.onload = function(d) { window.fileNotes = $.map(new MIDIFile(window.SomeBuff = d.target.result).getMidiEvents().filter(function(e) { return e.subtype === 9 || e.subtype === 8 }), function(e) { return { ms: e.playTime, note: (e.param1 - 27)/(67-27), on: e.subtype === 9 }; }) }; fr.readAsArrayBuffer(f); }) |
View debug.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View funJispZipLookupThingy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def getZipLookupUri zip callbackFuncName (+ 'http://api.geonames.org/postalCodeLookupJSON?postalcode=' zip '&country=US&callback=' callbackFuncName '&username=jimmyhoffa')) | |
(def makeSimpleJsonpGetRequest uri | |
(do (= xhr (new XMLHttpRequest())) | |
(xhr.open 'GET' uri true) | |
(= xhr.onload (fn result (eval result.target.response))) | |
(xhr.send))) | |
(def createGeoNameResponseHandler callbackFunc | |
(do |
View gist:b4fd667b30249008fa6c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let filter (key:string,items:FileSummary seq) = | |
(getGroupLineCount items) > threshold | |
summaries | |
|> Seq.groupBy (fun x->x.RelativePath) | |
|> (fun group -> if useThresholds then (Seq.filter filter group) else group ) | |
|> (fun group -> if useTakeLimits.IsSome then Seq.take(useTakeLimits.Value) group else group) | |
|> Seq.map (fun (key,items) -> (key, items |> Seq.sumBy (fun i->i.LineCount) , items)) | |
|> Seq.sortBy (fun (key,l,items)-> -l) | |
View LogicInTypeSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace LogicInTypeSystem | |
{ | |
public class Person | |
{ |
View gist:8244850
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure we got a filename on the command line. | |
if (process.argv.length < 3) { | |
console.log('Usage: node ' + process.argv[1] + ' FILENAME'); | |
process.exit(1); | |
} | |
// Read the file and print its contents. | |
var fs = require('fs') | |
, filename = process.argv[2] | |
, happy = ""; | |
fs.readFile(filename, 'utf8', function(err, data) { |
View gist:7552976
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PersonModel | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public int Age { get; set; } | |
public bool Amazing { get; set; } | |
public PersonModel OnlyFriend { get; set; } | |
} |
View gist:6995513
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KbdButton.prototype = { | |
installHotkey: function() { | |
// Install a single anchor in the body to catch our accessor. | |
var accessor = $( "<a accesskey='k' style='display:none; position:absolute;'>" ); | |
$( "body" ).append( accessor ); | |
var whichKey = 0; | |
var keyCaptureDialog = $("body").append('<div id="captureKeys"></div>').dialog({ | |
resizable: false, |