Skip to content

Instantly share code, notes, and snippets.

View modulexcite's full-sized avatar
🎯
Focusing

modulexcite

🎯
Focusing
View GitHub Profile
switch(policy.LanguageType)
{
case LanguageTypes.CSharp:
// process c# rules
break;
case LanguageTypes.Python:
//process python rules
break;
class Program
{
static void Main(string[] args)
{
const string mom = "mom";
const string mother = "mother";
const int iterations = 10000;
var sw = new Stopwatch();
sw.Start();
function Stopwatch()
{
var sw = this;
var start = null;
var stop = null;
var isRunning = false;
sw.__defineGetter__("ElapsedMilliseconds", function()
{
return (isRunning ? new Date() : stop) - start;
using System;
using System.Diagnostics;
namespace JsEnginePerformanceComparison
{
class Program
{
static void Main()
{
var done = false;
var ret = [], tmp, num = 500, i = 1024;
for ( var j1 = 0; j1 < i * 15; j1++ ) {
ret = [];
ret.length = i;
}
for ( var j2 = 0; j2 < i * 10; j2++ ) {
ret = new Array(i);
}
@modulexcite
modulexcite / Crypto.cs
Last active August 29, 2015 14:23 — forked from rushfrisby/Crypto.cs
using System;
using System.Security.Cryptography;
using System.Text;
public static class Crypto
{
#region MD5
public static string HashMD5(string phrase)
{
using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Web;
USE [master]
GO
IF OBJECT_ID('dbo.sp_foreachdb') IS NULL EXEC ('CREATE PROCEDURE dbo.sp_foreachdb AS RETURN 0')
GO
ALTER PROCEDURE dbo.sp_foreachdb (
@command NVARCHAR(MAX),
@replace_character NCHAR(1) = N'?',
@print_dbname BIT = 0,
@print_command_only BIT = 0,
<#
This code illustrates highlighting a line based on a cell value
Search-CellValue will help identify the rows we care about
Format-Cell will format these rows
Prerequisite: Download and load up PSExcel http://ramblingcookiemonster.github.io/PSExcel-Intro/
#>
# View the help on the primary commands we will be using
Get-Help Search-CellValue -Full
function Get-EnumValues {
<#
.SYNOPSIS
Return list of names and values for an enumeration object
.DESCRIPTION
Return list of names and values for an enumeration object
.PARAMETER Type
Pass in an actual type, or a string for the type name.