Skip to content

Instantly share code, notes, and snippets.

View tig's full-sized avatar

Tig tig

View GitHub Profile
@tig
tig / Utils.cs
Created February 1, 2012 08:24
Base64 conversion
public static string ToBase64(string encode) {
Byte[] btByteArray = null;
System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
btByteArray = encoding.GetBytes(encode);
string sResult = System.Convert.ToBase64String(btByteArray, 0, btByteArray.Length);
sResult = sResult.Replace("+", "-").Replace("/", "_");
return sResult;
}
public static string FromBase64(string decode) {
@tig
tig / WINTIME.C
Created February 13, 2012 01:38
This module contains functions for managing time and date strings using internationalization.
/************************************************************************
*
* Module: WINTIME.C
*
* System: Microsoft C 6.00A, Windows 3.00
*
* Remarks:
*
* This module contains functions for managing time and date strings
* using internationalization.
@tig
tig / spit.c
Created February 13, 2012 01:51
Blast from the past: SPIT - A print formatting utility from 1987
/*
spit.c (C) KindelCo Software Systems, 1987, 1988
SPIT - A print formatter for the PC
Author: Charles E. Kindel, Jr. (tigger)
Started: July 18, 1987
Version: 1.53
@tig
tig / ez.c
Created February 13, 2012 02:33
EZ: a text editor I wrote in 1987
/* ez.c
ez.c (c) KindelCo Software Systems, 1987
EZ - The tlw Screen Editor
Author: Charles E. Kindel, Jr. (tigger)
Started: July 17, 1987
@tig
tig / gist:1814218
Created February 13, 2012 06:20
Mono compiler says "The variable `myStream' is assigned but its value is never used"
private void toolStripButtonChooseText_Click(object sender, EventArgs e)
{
Stream myStream = null;
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = ".";
openFileDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
openFileDialog.FilterIndex = 1;
openFileDialog.RestoreDirectory = false;
@tig
tig / app.js
Created March 17, 2012 19:52
Connect-assetmanager question
require('./bootstrap/bootstrap');
const express = require('express');
const auth = require('connect-auth');
const config = require('./config');
const ConnectCouchDB = require('connect-couchdb')(express);
const assetManager = require('connect-assetmanager');
const assetHandler = require('connect-assetmanager-handlers');
const port = config.keys.port;
echo chars:\u20AC| nc 192.168.0.5 5150 -w 1
@tig
tig / cmdline
Created March 27, 2012 16:57
unicode command line for mce controller
echo chars:\u20AC| nc.exe 192.168.0.5 5150 -w 1
@tig
tig / fixcal.cs
Created April 1, 2012 08:11
Exchange Web Services sample to remove "Copy: " from every calendar item on a calendar
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Web;
using System.Net;
using Microsoft.Exchange.WebServices.Autodiscover;
using Microsoft.Exchange.WebServices.Data;
namespace fixcal
{
@tig
tig / amelia.dotless.css
Created June 22, 2012 00:46
Amelia Bootswatch generated with dotless
/*!
* Bootstrap v2.0.4
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/