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
| public class DynamicModel : DynamicObject | |
| { | |
| private readonly bool _isStrictGet; | |
| public IDictionary<string, object> _dict; | |
| public DynamicModel(string objectName = null, IDictionary<string, object> dict = null, bool isStrictGet = false) | |
| { | |
| ObjectName = objectName; | |
| _dict = dict ?? new Dictionary<string, object>(); | |
| _isStrictGet = isStrictGet; |
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
| public DynamicModel Convert(Dictionary<string, string> dictionary, bool isStrictGet) | |
| { | |
| var customDynamicObject = new DynamicModel(isStrictGet: isStrictGet); | |
| foreach (var key in dictionary.Keys) | |
| { | |
| AddValueToExpandoRecursive(customDynamicObject, key, dictionary[key], isStrictGet); | |
| } | |
| return customDynamicObject; |
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
| //Double open angle brackets | |
| //Using an open angle bracket at the end of the vector instead of a close angle bracket causes different behavior in Netscape //Gecko rendering. Without it, Firefox will work but Netscape won't: | |
| <iframe src=http://ha.ckers.org/scriptlet.html < |
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
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using SEEK.Employment.Profile.API.Validation; | |
| public class AntiXssValidator : IAntiXssValidator | |
| { | |
| public static string[] XSSTagStringsForDoubleOpening = {"iframe", | |
| "script", | |
| "style", | |
| "input" |
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
| MyApp.directive('placeholder', function($timeout) { | |
| return { | |
| restrict: 'A', | |
| require: 'ngModel', | |
| link: function(scope, element, attr, ctrl) { | |
| //check whether it support placeholder and cache it | |
| scope.supportsPlaceholders = scope.supportsPlaceholders || function() { | |
| return "placeholder" in document.createElement("input"); | |
| }; |
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
| * { | |
| padding: 0; | |
| margin: 0; | |
| } | |
| body { | |
| font-size: 14px; | |
| font-family: Georgia, "Bitstream Charter", serif; | |
| color: #333333; | |
| text-align: center; |
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
| library(reshape2) | |
| library(foreach) | |
| memory.limit(1000000) | |
| # parameters | |
| data.dir <- 'C:/Projects/KK/BigData/FacebookFaceDetection/data/' | |
| patch_size <- 10 | |
| search_size <- 2 | |
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
| KK.factory('httploadingInterceptor',['$q','$rootScope', function ($q, $rootScope) { | |
| return function (promise) { | |
| $rootScope.loading = true; | |
| return promise.then(function (response) { | |
| // hide the spinner | |
| $rootScope.loading = false; | |
| return response; |
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
| 'use strict'; | |
| SEEK.factory('InjectHtmlService', ['mobileRoot', '$http', 'TokenHandler', function (mobileRoot, $http, tokenHandler) { | |
| var resource = {}; | |
| resource.injectHtml = function (url, success, error) { | |
| $(document).on('submit', 'form', function () { | |
| //add site | |
| submitPost(mobileRoot + $(this).attr('action')); |
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
| KK.factory('TokenHandler', ['$cookieStore', function ($cookieStore) { | |
| var tokenHandler = {}; | |
| tokenHandler.setToken = function (newToken) { | |
| $cookieStore.put("X-Authorization-Token", newToken); | |
| console.log('set token ' + newToken); | |
| }; | |
| tokenHandler.getToken = function () { | |
| console.log('get cookie ' + $cookieStore.get("X-Authorization-Token")); |