Skip to content

Instantly share code, notes, and snippets.

public class CustomContractResolver : DefaultContractResolver
{
private Dictionary<string, string[]> PropertyMappings { get; set; }
public CustomContractResolver()
{
this.PropertyMappings = new Dictionary<string, string[]>
{
{"Values", new string[]{"AU", "EU" } }
};
const nsfw = require('nsfw');
const path = require('path');
function watch(pathParam,fnName) {
console.log(pathParam);
const absolutePath = pathParam;// path.resolve(pathParam)
console.log(`Watching ${absolutePath}`)
nsfw(absolutePath,
function(events) {
@section Scripts {
<script src="~/Scripts/tcp/pdfmake.min.js"></script>
<script src="~/Scripts/tcp/vfs_fonts.js"></script>
<script type="text/javascript">
$(function () {
$('.form-horizontal :input').attr('disabled', 'disabled');
});
function printPdfMake() {
$(document).ready(function(){
function resultCb(res){
console.log(res);
res.sort(function(a, b){
if(a < b) return -1;
if(a > b) return 1;
return 0;
});
$.each(res,function(title){
$(".news-body").append("<div>" + title+"</div");
############ These can be changed ########################
#Homepage to start the crawl - n.b. the / forwardslash matters....
$homepage = "qds.html"
#Used as validation for relative links, this also stops the site crawling outside of this domain (by breaking the URL for anythign other #than $rawdomain)
$rawdomain = ""
$outputfile = "E:\scripts\listofURLs.txt"
$secretfile = "E:\scripts\secret1.txt"
@bhavjot
bhavjot / sortedSet_minimumLoss.cs
Created March 10, 2017 05:46
Minimum Loss - Sorted Set - Perfect Solution - Hacker Rank
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static void Main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
int n = Convert.ToInt32(Console.ReadLine());
string[] arr_temp = Console.ReadLine().Split(' ');
long[] arr = Array.ConvertAll(arr_temp,Int64.Parse);
@bhavjot
bhavjot / List_binarysearch_minLoss.cs
Created March 10, 2017 05:37
Minimum Loss - Binary Search - some test cases still fail - not a solution
using System;
using System.Collections.Generic;
using System.IO;
class Solution {
static void Main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
int n = Convert.ToInt32(Console.ReadLine());
string[] arr_temp = Console.ReadLine().Split(' ');
long[] arr = Array.ConvertAll(arr_temp,Int64.Parse);
@bhavjot
bhavjot / reverseArray.cs
Created March 10, 2017 05:14
Reverese Array- Hacker Rank
using System;
namespace HackerRank
{
class Program
{
static void Main(string[] args)
{
int n = Convert.ToInt32(Console.ReadLine());
string[] arr_temp = Console.ReadLine().Split(' ');