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
function createMarkdown() { | |
var pagedown = require('pagedown'); | |
var converter = new pagedown.getSanitizingConverter(); | |
process.stdout.write(converter.makeHtml(lines)); | |
} | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
var lines = ""; | |
process.stdin.on('data', function(chunk) { |
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
/* | |
* In my project I added the GUID to my implementation of IUserIdentity | |
* so I had access to it later by a simple cast. In Nancy you'd just want | |
* to fetch it the same way it's already done in the Before hook. | |
* | |
* Also note, I'm using my company's style guide, not Nancy's. | |
*/ | |
// This is a Drop in replacement for the after hook used by FormsAuth right now. |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Treemap - Neat Zoom Effect</title> | |
<script type="text/javascript" src="http://www.billdwhite.com/wordpress/wp-content/js/browserdetect/browserdetect.js"></script> | |
<script type="text/javascript" src="http://www.billdwhite.com/wordpress/wp-content/js/d3/d3.js"></script> | |
<style type="text/css"> | |
body { | |
overflow: hidden; |
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.IO; | |
using MsieJavaScriptEngine; | |
public class CoffeeScriptCompiler : ContentCompiler { | |
public CoffeeScriptCompiler() { | |
Javascript.Engine.RegisterCompiler("CoffeeScript", LoadCoffeeScript, MakeCompiler); | |
} |
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
<html> | |
<head></head> | |
<body> | |
<iframe id='test' src="http://www.sadtrombone.com?play=true"></iframe> | |
<script> | |
function trySadTrombone() { | |
var test = document.getElementById("test"); | |
test.src = test.src; | |
console.log(test.srcdoc); | |
} |
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 Nancy; | |
namespace MyNamespace | |
{ | |
public class MyModule : NancyModule { | |
public MyModule() { | |
Get["/"] = GetRoot; | |
} | |
private dynamic GetRoot(dynamic _) { |
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
<Query Kind="Program"> | |
<Reference><RuntimeDirectory>\System.Drawing.dll</Reference> | |
<NuGetReference>Accord.Imaging</NuGetReference> | |
<Namespace>Accord.Imaging</Namespace> | |
<Namespace>System.Drawing</Namespace> | |
<Namespace>System.Drawing.Imaging</Namespace> | |
<Namespace>Accord.MachineLearning</Namespace> | |
</Query> | |
void Main() |
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
Ractive.components.tooltip = Ractive.extend | |
template: "<div class='tooltip-container' style='position: absolute; top: 0; bottom: 0; right: 0; left: 0' decorator='tooltip'></div>" | |
data: { | |
_show: false | |
} | |
onrender: () -> | |
pos = $(@el).css('position') | |
if pos != 'absolute' && pos != 'fixed' && pos != 'relative' |
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
{{#if results}} | |
<header><h3>Results</h3></header> | |
<div><button on-click="saveCSV()">Export As CSV</button></div> | |
{{#each resultSets}} | |
<div class='resultset'> | |
<h4> | |
<span>{{db}}</span> | |
{{#if statistics.SelectRows || statistics.SelectCount}} | |
<span class='counts'>{{statistics.SelectRows}} row(s) selected with {{statistics.SelectCount}} select(s)</span> | |
{{/if}} |
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
# In Application Controller: | |
# Rename your current version of 'current_user' like so: | |
def _current_user | |
# Current User Code | |
end | |
# Change _current_user to something like this: | |
def current_user | |
model = self.class.class_variable_get :@@model rescue nil |