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
$postbuild = "" | |
foreach ($arg in $args) { | |
switch ($arg) { | |
"run" { $postbuild = "run" } | |
"debug" { $postbuild = "debug" } | |
} | |
} | |
if (!(test-path build)) { mkdir build } | |
if (!(test-path build/obj)) { mkdir build/obj } |
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
std::shared_ptr<FontAtlas> generateFontAtlas(int fontId, int fontSizeInPixels, int sdfPadding) | |
{ | |
/* ACTION PLAN: | |
create a new list (vector) in which to stage a set of character glyphs, each prepared in isolation | |
for each character: | |
load the character and its metrics from the font engine, using a very large font size (10 times the requested font size) | |
create a new image expanded to include padding for the distance field | |
copy the character bitmap into the centre of the image | |
render the distance field into the image | |
downsize the image |
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
<template> | |
<require from="./linked-data"></require> | |
<table> | |
<tbody> | |
<tr repeat.for="pair of pairs()"> | |
<td>${pair.predicate}</td> | |
<td> | |
<linked-data subject.bind="this" predicate.bind="pair.predicate" value.bind="pair.value"></linked-data> | |
</td> | |
</tr> |
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 runInScope(main, sources, context, ...args) { | |
if(!main) { | |
throw new Error('A "main" function must be supplied, which will be called in scope and from which a (sinks) object will be returned'); | |
} | |
if(!sources) { | |
throw new Error('A source drivers object must be supplied, to which scoping can be applied'); | |
} | |
if(!context) { | |
throw new Error('A scope context object must be supplied, either as a string, or as an object of key/value pairs'); | |
} |
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
import logger from './logger'; | |
let log = logger('Category'); | |
log.trace('Just tracing stuff'); | |
log.debug('Here is a debug message'); | |
log.success('The successful thing happened that we wanted to happen'); | |
log.info('Information makes the world go around, and here is that string:', str); | |
log('An info message can be logged using short form'); | |
log.warn('You better be careful about this kind of thing'); |
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
# ---------------------------------------------------------------------------------------------------------------------------- | |
# Generic VC++ Make Script | |
# ---------------------------------------------------------------------------------------------------------------------------- | |
# Note: Make sure that vcvars.bat has been run in the current powershell session | |
# | |
# Power Shell Reference: http://ss64.com/ps/ | |
# VC++ Compiler Options: https://msdn.microsoft.com/en-us/library/19z1t1wy.aspx | |
# VC++ Linker Options: https://msdn.microsoft.com/en-us/library/y0zzbyt4.aspx | |
# Plugin handling library: http://apolukhin.github.io/Boost.DLL/ | |
# ---------------------------------------------------------------------------------------------------------------------------- |
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> | |
<title>Sortable List</title> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
<script src="sortable-list.js"></script> | |
<script> | |
$(function() { $('#rows').sortablelist(); }); | |
</script> | |
<style type="text/css"> |
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
/* | |
MyIOC - IOC Container for TypeScript/JavaScript | |
designed and developed by Nathan Ridley | |
------------------------------------------------------------------ | |
Copyright (c) 2013 Nathan Ridley (axefrog@gmail.com). | |
All rights reserved. | |
Redistribution and use in source and binary forms are permitted | |
provided that the above copyright notice and this paragraph are |
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
// both arrays should be presorted | |
function computeArrayUpdateOperations(oldarr, newarr, compare) { | |
if (!compare) | |
compare = computeArrayUpdateOperations.compare; | |
var l = 0, r = 0, p = 0, | |
op = null, ops = [], | |
leof = l >= oldarr.length, reof = r >= newarr.length; | |
while (!(leof && reof)) { | |
if (!leof && (reof || compare(oldarr[l], newarr[r]) < 0)) { | |
if (op && op[0] === 'i') |
OlderNewer