Skip to content

Instantly share code, notes, and snippets.

View robertstefan's full-sized avatar

Robert Ștefan Stănescu robertstefan

View GitHub Profile
@kig
kig / arrayToNative.js
Created May 18, 2012 09:35
Change Typed Array endianness
ArrayBuffer.littleEndian = new Int8Array(new Int16Array([1]).buffer)[0] > 0;
var arrayToNative = function(array, arrayIsLittleEndian) {
if (!!arrayIsLittleEndian == ArrayBuffer.littleEndian) {
return array;
} else {
return flipArrayEndianness(array);
}
};
@lidopaglia
lidopaglia / ConvertFrom-Markdown.ps1
Created September 17, 2012 20:04
PowerShell function to convert Markdown to HTML via Github API
<#
.SYNOPSIS
Converts Markdown formatted text to HTML.
.DESCRIPTION
Converts Markdown formatted text to HTML using the Github API. Output is "flavored" depending on
the chosen mode. The default output flavor is 'Markdown' and includes Syntax highlighting and
Github stylesheets.
Based on the Ruby version by Brett Terpstra:
http://brettterpstra.com/easy-command-line-github-flavored-markdown/
@k33g
k33g / gist:3959903
Created October 26, 2012 16:57
Patterns & Typescript

##The Singleton Pattern

class SantaClaus {

	private static uniqueInstance : SantaClaus;
	
@bzerangue
bzerangue / currency-symbols.xml
Last active September 27, 2024 03:34
World currencies with their symbols
<?xml version="1.0" encoding="UTF-8"?>
<!--
## SOURCE: xe.com
-->
<currency-symbol count="115">
<entry code="ALL" unicode-decimal="76, 101, 107" unicode-hex="4c, 65, 6b">Albania Lek</entry>
<entry code="AFN" unicode-decimal="1547" unicode-hex="60b">Afghanistan Afghani</entry>
<entry code="ARS" unicode-decimal="36" unicode-hex="24">Argentina Peso</entry>
<entry code="AWG" unicode-decimal="402" unicode-hex="192">Aruba Guilder</entry>
<entry code="AUD" unicode-decimal="36" unicode-hex="24">Australia Dollar</entry>
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 28, 2026 00:09
5 entertaining things you can find with the GitHub Search API
@joshbeckman
joshbeckman / gist:7867934
Created December 9, 2013 06:00
Handle drag-n-drop JSON file upload and parsing with javascript.
if (window.File && window.FileReader && window.FileList && window.Blob) {
// Great success!
function handleJSONDrop(evt) {
evt.stopPropagation();
evt.preventDefault();
var files = evt.dataTransfer.files;
// Loop through the FileList and read
for (var i = 0, f; f = files[i]; i++) {
// Only process json files.
@debasishg
debasishg / gist:8172796
Last active April 12, 2026 23:53
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t
@olmokramer
olmokramer / css-color-regex
Last active December 19, 2024 11:23
Regex for CSS colors: hex, rgb(a), hsl(a)
/(#([0-9a-f]{3}){1,2}|(rgba|hsla)\(\d{1,3}%?(,\s?\d{1,3}%?){2},\s?(1|0?\.\d+)\)|(rgb|hsl)\(\d{1,3}%?(,\s?\d{1,3}%?\)){2})/i
@dfinke
dfinke / PSSummit.ps1
Last active April 8, 2023 06:44
PowerShell GUI for viewing YouTube Videos of the PowerShell NA Summit 2015
Add-Type -AssemblyName PresentationFrameWork
$MainWindow=@'
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Topmost="True"
WindowStartupLocation="CenterScreen"
Title="PowerSHell Summit Videos" Height="850" Width="1200">
<Grid>
<Grid.RowDefinitions>
@ovrmrw
ovrmrw / Program.cs
Last active September 28, 2021 14:25
Topshelf + OWIN Self-Host + ASP.NET WebAPI + Ninject
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Tracing;
using System.Reflection;
using Owin;