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 htmlEncode(value){ | |
//create a in-memory div, set it's inner text(which jQuery automatically encodes) | |
//then grab the encoded contents back out. The div never exists on the page. | |
return $('<div/>').text(value).html(); | |
} | |
function htmlDecode(value){ | |
return $('<div/>').html(value).text(); | |
} |
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
angular.injector(['ng', 'ngSanitize']).get('$sanitize')('asdf<script>FooBar</script>') |
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
.directive('ngName', function() { | |
return { | |
restrict: 'A', | |
require: ['^form', 'ngModel'], | |
link: function($scope, ele, attr, ctrl) { | |
var formCtrl = ctrl[0]; | |
var ngModel = ctrl[1]; | |
var name = $scope.$eval(attr.mppName); | |
if (ngModel.$name != name) { | |
formCtrl.$removeControl(ngModel); |
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 jenkins.model.* | |
import hudson.model.* | |
import hudson.tasks.* | |
import hudson.tools.* | |
def inst = Jenkins.getInstance() | |
def desc = inst.getDescriptor("hudson.tasks.Ant") | |
def versions = [ |
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
#!groovy | |
step([$class: 'GitHubCommitStatusSetter', | |
contextSource: [$class: 'ManuallyEnteredCommitContextSource', context: 'preflight-build'], | |
statusResultSource: [$class: 'ConditionalStatusResultSource', | |
results: [[$class: 'AnyBuildResult', message: 'Preflight build successful', state: 'SUCCESS']]]]) |
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
#!groovy | |
node() { | |
// checkout clean code | |
stage("checkout") { | |
checkout scm | |
sh "git clean -fdx" | |
} | |
stage("gitUrl" ) { |
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
#!groovy | |
/** | |
* Requires tool definitions for nodejs, jdk, maven, and ant | |
* Requires config files .npmrc and maven-settings.xml | |
*/ | |
node() { | |
// checkout clean code | |
stage("checkout") { | |
checkout scm |
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
const path = require('path') | |
, Umzug = require('umzug') | |
, Bluebird = require('bluebird') | |
const db = { | |
// sequelize instance | |
sequelize: null, | |
// Sequelize constructor | |
Sequelize: 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
'use strict'; | |
const request = require('request'); | |
module.exports = function forward(req, res, next) { | |
var myRequest = request({ | |
url: req.url, | |
headers: req.headers | |
}); | |
req.pipe(myRequest) |
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
/* | |
Spacing | |
- - - - - - - - - - - - - - - - - - - - - - - - - | |
Helper classes for spacing like margin and padding. | |
Class names follow this convention: | |
.[type][direction][size] |
OlderNewer