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.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Web.Mvc; | |
using System; | |
/// MVC2 compatiable version of @haacked security checking class, for details, see | |
/// - http://haacked.com/archive/2017/08/10/mvc-action-security-audit/ |
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 * as ditto from "./ditto"; | |
// Yeah, I know use Karma, or assert or something ... I'm just playing around, sue me :-) | |
class Person { | |
firstName: string = ""; | |
lastName: string = ""; | |
partner: Person = null; | |
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
/** | |
* Module: "ditto" (coz the module delivers new objects, and uber [kinda used to] sounds cool!) | |
* Description: Set of [generic] helper methods for doing [very simple!] immutable type for TypeScript/ES6 | |
* Tests: See set of noddy tests at ???? | |
* Source: https://gist.github.com/toepoke/fafa3cbe7f8592d6286237bebe43af19 | |
* Usage: | |
* "import * as ditto from './ditto';" | |
* ... | |
* ditto.updateItem( ... ) | |
* Revisions: |
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
{ | |
/* | |
// Place your snippets for TypeScript here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, ${id} and ${id:label} and ${1:label} for variables. Variables with the same id are connected. | |
// Example: | |
"Print to console": { | |
"prefix": "log", | |
"body": [ | |
"console.log('$1');", |
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
module.exports ..... blah { | |
var target = (grunt.option("target") || "live"); | |
var webConfig = "deployment/" + target + "/website/web.config"; | |
xmlpoke: { | |
website: { | |
options{ | |
.... | |
}, |
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
/// <summary> | |
/// showey - noddy example of how to add an extension method to jQuery | |
/// <summary> | |
jQuery.fn.showey = function() { | |
for (var i=0; i < this.length; i++) { | |
var $ele = $(this[i]); | |
$ele.show("fast", "linear"); | |
} | |
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
/// <summary> | |
/// Takes advantage of the jQuery UI framework icons (see http://jqueryui.com/themeroller/) to pretty | |
/// up checkboxes | |
/// </summary> | |
/// <param name="filter">jQuery selector targetting the checkboxes, e.g. "input[type=checkbox]" attaches to all checkboxes</param> | |
function prettyCheckboxes(filter) { | |
// some constants for the icons, here are some variants you might want to consider: | |
// onClass offClass | |
// "ui-icon-check" "ui-icon-close" | |
// "ui-icon-circle-check" "ui-icon-circle-close" |
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
var onClass = "ui-icon-circle-check", offClass = "ui-icon-circle-close"; | |
$( "input:checked[type=checkbox] " ).button({ icons: {primary: onClass} }); | |
$( "input[type=checkbox]:not(:checked)" ).button({ icons: {primary: offClass} }); | |
$( "input[type=checkbox]" ).click(function(){ | |
var swap = function(me, toAdd, toRemove) { | |
// find the LABEL for the checkbox | |
// ... which should be _immediately_ before or after the checkbox | |
var node = me.next(); |
NewerOlder