Skip to content

Instantly share code, notes, and snippets.

@OrigamiTech
OrigamiTech / getPassword
Created January 22, 2011 21:46
Function to get password input from a CLI without displaying the password.
static string getPassword()
{
string Pass = "";
char c = Console.ReadKey(true).KeyChar;
while (c != (char)0x0D)
{
if (c == 0x08)
{
if (Pass.Length > 0)
{
@OrigamiTech
OrigamiTech / BrainFrack
Created January 21, 2011 15:28
BrainFuck interpreter in C#
using System;
namespace BrainFrack
{
class Program
{
static unsafe void Main(string[] args)
{
int size = 30000;
byte* ptr = (byte*)System.Runtime.InteropServices.Marshal.AllocCoTaskMem(size);
for (int i = 0; i < size; i++) *ptr++ = 0;
using System;using System.Runtime.InteropServices;
namespace BrainFrack{
class Program{
static unsafe void Main(string[]args){
string c=Console.ReadLine();
int s=30000;
byte* p=(byte*)Marshal.AllocCoTaskMem(s);
for(int i=0;i<s;i++)*p++=0;
p-=s;
Console.Clear();
@OrigamiTech
OrigamiTech / KeyGenJukebox Downloader
Created January 3, 2011 16:14
Downloads all the music from keygenjukebox.com
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Text.RegularExpressions;
using System.IO;
namespace KGJ_DL
{
string suffix(int n){return(n%10==1&&n%100!=11?"st":(n%10==2&&n%100!=12?"nd":(n%10==3&&n%100!=13?"rd":"th")));}
@OrigamiTech
OrigamiTech / Epic if statement
Created December 7, 2010 21:57
to detect if a character is a letter or not.
if ((((((((((((((((((((((((((((((((((((((((((((((((((((ch == 'A') | (ch == 'B')) | (ch == 'C')) | (ch == 'D')) | (ch == 'E')) | (ch == 'F')) | (ch == 'G')) | (ch == 'H')) | (ch == 'I')) | (ch == 'J')) | (ch == 'K')) | (ch == 'L')) | (ch == 'M')) | (ch == 'N')) | (ch == 'O')) | (ch == 'P')) | (ch == 'Q')) | (ch == 'R')) | (ch == 'S')) | (ch == 'T')) | (ch == 'U')) | (ch == 'V')) | (ch == 'W')) | (ch == 'X')) | (ch == 'Y')) | (ch == 'Z')) | (ch == 'a')) | (ch == 'b')) | (ch == 'c')) | (ch == 'd')) | (ch == 'e')) | (ch == 'f')) | (ch == 'g')) | (ch == 'h')) | (ch == 'i')) | (ch == 'j')) | (ch == 'k')) | (ch == 'l')) | (ch == 'm')) | (ch == 'n')) | (ch == 'o')) | (ch == 'p')) | (ch == 'q')) | (ch == 'r')) | (ch == 's')) | (ch == 't')) | (ch == 'u')) | (ch == 'v')) | (ch == 'w')) | (ch == 'x')) | (ch == 'y')) | (ch == 'z')) { /*code*/ }
/*http://cdn.ghostworksinc.com/github.css*/
@charset "utf-8";
@import url(http://fonts.googleapis.com/css?family=Droid+Sans:regular);
h1,h2,body { font-family: 'Droid Sans', arial, sans-serif; }
a { text-decoration: none; }
/*http://cdn.ghostworksinc.com/header.css*/
@OrigamiTech
OrigamiTech / RegexTextBox.cs
Created November 18, 2010 12:56
A standard C# System.Windows.Forms.TextBox, which changes color based on the specified Regex pattern.
using System;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
namespace WKCore
{
public partial class RegexTextBox : TextBox
{