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.IO; | |
using System.Runtime.Serialization.Formatters.Binary; | |
namespace IsKernel.Pool.Vanilla.Memory | |
{ | |
public static class GenericCopyMaker<T> | |
{ | |
public static T GetDeepCopy(object objectToCopy) | |
{ |
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
curl -L http://cpanmin.us | perl - --sudo App::cpanminus | |
#Install module with dependencies | |
sudo cpanm Foo::Bar |
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 File::Slurp; | |
#Reads an entire file into a string (scalar) | |
my $text = read_file( 'index.html' ) ; | |
#Writes a string (scalar) into a file | |
write_file( 'index_2.html', $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
using System; | |
using System.Collections.Generic; | |
using IsKernel.Api.Pool.Currency; | |
namespace GrandTrunkCurrenciesApiExample | |
{ | |
class Program | |
{ | |
public static void Main(string[] args) | |
{ |
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
//The RIGHT way | |
[Test] | |
public void GetConversionRate_DateFutureParameter_ThrowsException() | |
{ | |
//This will always return a date that will be in the future | |
DateTime future = DateTime.Now.AddYears(1); | |
Assert.Throws( typeof(CurrencyConversionException), | |
() => GrandTrunkCurrencyConversionService.Instance | |
.GetConversionRate(TEST_CURRENCY_NAME_US_DOLLAR, | |
TEST_CURRENCY_NAME_AU_DOLLAR, |
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
//Equivalent of C# Environment.Newline | |
System.getProperty("line.separator"); |
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; | |
public class Singleton | |
{ | |
private static Singleton instance; | |
private Singleton() {} | |
public static Singleton Instance | |
{ |
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
<# | |
When you attempt to open, delete or rename a file or folder using Windows NT | |
Explorer, File Manager or a command prompt, you may receive one of the | |
following error messages: | |
<drive>:\<folder> is not accessible | |
The file or directory is corrupt and non-readable. | |
The file or directory is corrupt and non-readable. | |
The file or directory \<folder> is corrupt and unreadable. | |
#> | |
#The drive you want to check |
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
#Allows execution PowerShell scripts on System | |
Set-ExecutionPolicy Unrestricted |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>example</title> | |
</head> | |
<body> | |
<table border="1" id="sortableTable"> | |
<thead> |
NewerOlder