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; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.IO; | |
using System.Runtime.Serialization.Formatters.Binary; | |
using StackExchange.Redis; | |
using WebApp; | |
namespace ClassLib.CacheExtension |
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
/* | |
Example for quick Java compilation and unit tests in VS Code. | |
Works well with simple BlueJ projects. | |
Hit Ctrl+Shift+B to compile currently open file with javac. | |
Hit Ctrl+Shift+T to test currently open test class. | |
See red wiggles for compilation errors / failed assertions or click exclamation mark in the status bar. | |
Uses a few workarounds for individual commands per task and filename without extension. | |
This is written for Windows but it should be easy to adopt for Linux and Mac. | |
*/ | |
{ |
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
// Bonfire: Roman Numeral Converter | |
// Author: @narshe1412 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-roman-numeral-converter | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function convert(number) { | |
if ((number < 0) || (number > 3999)) {alert("Please select a number between 1 and 3999");} | |
if (number >= 1000) return "M" + convert(number - 1000); | |
if (number >= 900) return "CM" + convert(number - 900); | |
if (number >= 500) return "D" + convert(number - 500); |
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
// Bonfire: Diff Two Arrays | |
// Author: @narshe1412 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-diff-two-arrays | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function diff(arr1, arr2) { | |
var newArr = []; | |
// Same, same; but different. | |
for (i=0; i < arr1.length; i++){ | |
if (arr2.indexOf(arr1[i]) < 0){ |
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
// Bonfire: Sum All Numbers in a Range | |
// Author: @narshe1412 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-sum-all-numbers-in-a-range | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function sumAll(arr) { | |
var max = Math.max(...arr); | |
var min = Math.min(...arr); | |
var fullArray = []; | |
for (var i = min; i <= max; i++) { |
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
// Bonfire: Where do I belong | |
// Author: @narshe1412 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-where-do-i-belong# | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function where(arr, num) { | |
// Find my place in this sorted array. | |
var sortedArray = arr.sort(function(a,b){ | |
return a-b; | |
}); |
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
// Bonfire: Seek and Destroy | |
// Author: @narshe1412 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-seek-and-destroy | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function destroyer(arr) { | |
// Remove all the values | |
var killerArray = Array.prototype.slice.call(arguments); | |
killerArray.splice(0,1); | |
var solution = arr.filter(function(val){ |
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
// Bonfire: Mutations | |
// Author: @narshe1412 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-mutations | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function mutation(arr) { | |
var strParent = arr[0].toLowerCase().split(""); | |
// console.log("Parent string: "+strParent); | |
var strKey= arr[1].toLowerCase().split(""); | |
// console.log("key string:"+strKey); |
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
// Bonfire: Slasher Flick | |
// Author: @narshe1412 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-slasher-flick | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function slasher(arr, howMany) { | |
// it doesn't always pay to be first | |
arr.splice(0,howMany); | |
return arr; | |
} |
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
// Bonfire: Chunky Monkey | |
// Author: @narshe1412 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-chunky-monkey | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function chunk(arr, size) { | |
// Break it up. | |
var result = []; | |
var innerArray = []; | |
for (var i=0; i<arr.length; i+=size) { |
NewerOlder