This file contains hidden or 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
// current | |
pvc.Task("build", () => { | |
pvc.Source("WebApplication.sln") | |
.Pipe(new PvcMSBuild( | |
buildTarget: "Clean;Build", | |
enableParallelism: true | |
)) | |
.Pipe(new PvcSomethingElse(...)); | |
}); |
This file contains hidden or 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
angular.module('...').directive('ancestorClass', function() { | |
'use strict'; | |
function link(scope, element, attrs) { | |
var targets = element.parents().filter(attrs.selector); | |
scope.$watch(attrs.class, function(value) { | |
for (var key in value) { | |
targets.toggleClass(key, value[key]); | |
} | |
}, true); |
This file contains hidden or 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
1. Syntax of `switch`. | |
2. Syntax of `for`. | |
3. Array initializers thorugh `{}` (so now it is both `new[] {}` and `{}`) | |
4. Having both `delegate(..) {..}` and `(..) => ..`. | |
5. Reserving `*` for rarely-used pointer syntax. |
This file contains hidden or 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 drawLizard(context, size) { | |
var c = context; | |
var s = size; | |
c.save(); | |
c.strokeStyle = '#000000'; | |
c.fillStyle = '#000000'; | |
var m = c.moveTo.bind(c); | |
var l = c.lineTo.bind(c); | |
c.beginPath(); |
This file contains hidden or 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
// https://gist.github.com/ashmind/8749472 | |
// jQuery plugin to load JS files from GitHub. | |
// NOT FOR PRODUCTION, use something like Bower instead. | |
// This is for quick iteration sites like CodePen or JSFiddle. | |
(function($) { | |
// this API requires blob SHA. get the SHA by requesting | |
// https://api.github.com/repos/:owner/:repo/contents/:path | |
$.loadScriptsFromGitHub = function(scripts, success) { |
This file contains hidden or 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
var init = function($) { | |
$("<style type='text/css'></style>").text('.cx { background: #f5f2f0; color: black; }' + | |
' .cx .tag { color: #999; }' + | |
' .cx .tag .title, .cx .css .attribute { color: #905; }' + | |
' .cx .tag .attribute, .cx .string, .cx .css .tag, .cx .css .class { color: #690; }' + | |
' .cx .tag .value, .cx .keyword { color: #07a; }' + | |
' .cx { font-family: Consolas, Courier New; position: absolute; z-index: 50000; left: 0; top: 0; right: 0; white-space: pre; }') | |
.appendTo($('head')); | |
var source = $('<code></code>').text(document.documentElement.outerHTML) |
This file contains hidden or 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
open System | |
type Test() = | |
let f = fun x -> x | |
member this.F with get() = f | |
let t = Test() | |
ignore (t.F "5") // 1 | |
// ignore (t.F 5) // 2 | |
Console.WriteLine(t.F.GetType().BaseType) |
This file contains hidden or 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
open System | |
let items = [-2; -1; 0; 1; 2] | |
let where = Seq.filter | |
let select = Seq.map | |
let each = Seq.iter | |
let positive x = x > 0 |
This file contains hidden or 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
private class QueryPropagatingRoute : RouteBase { | |
private readonly RouteBase target; | |
private readonly string[] queryStringKeys; | |
public QueryPropagatingRoute(RouteBase target, params string[] queryStringKeys) { | |
this.target = target; | |
this.queryStringKeys = queryStringKeys; | |
} | |
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) { |
This file contains hidden or 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
void CLASS gamma_curve (double pwr, double ts, int mode, int imax) | |
{ | |
int i; | |
double g[6], bnd[2]={0,0}, r; | |
g[0] = pwr; | |
g[1] = ts; | |
g[2] = g[3] = g[4] = 0; | |
bnd[g[1] >= 1] = 1; | |
if (g[1] && (g[1]-1)*(g[0]-1) <= 0) { |