Skip to content

Instantly share code, notes, and snippets.

@Svastikkka
Svastikkka / Search my gists.md
Created October 2, 2020 21:25 — forked from santisbon/Search my gists.md
How to search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@santisbon
santisbon / Search my gists.md
Last active June 3, 2024 00:22
How to search gists.

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@define-private-public
define-private-public / HttpServer.cs
Last active May 15, 2024 12:09
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@tracend
tracend / uniqueCode.js
Created December 31, 2013 22:56
Unique Code: Generate short IDs based on UTC Based on the C# version: http://schroedman.wordpress.com/2012/01/19/short-unique-id-in-c-without-using-guid/
function uniqueCode(){
var characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
var ticks = (new Date()).getTime().toString();
var code = "";
for (var i = 0; i < characters.length; i += 2) {
if ((i + 2) <= ticks.length) {
var number = parseInt(ticks.substr(i, 2));
if (number > characters.length - 1) {
var one = number.toString().substr(0, 1);
var two = number.toString().substr(1, 1);