Skip to content

Instantly share code, notes, and snippets.

View moritzuehling's full-sized avatar

Moritz moritzuehling

  • 01:35 (UTC +02:00)
View GitHub Profile
// LICENSE: MIT
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
8497501
8497700
8497800
8497900
8498000
8498100
8498200
8498300
8498400
8498500
declare module 'react-input-range' {
export = ReactInputRange.InputRange;
}
declare namespace ReactInputRange {
interface IRange {
min: number;
max: number;
}
#include "FastLED.h"
#define NUM_LEDS 120
#define DATA_PIN 6
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
for(int i = 0; i < NUM_LEDS; i++) {
leds[i].red = 5;
class App extends React.Component<any, any> {
public render() {
return (
<Router>
<Route path="/" component={HomePage}>
</Route>
</Router>
);
}
}
moritz:~$ cat program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestProject
{
class Program
@moritzuehling
moritzuehling / GetCSGODir.cs
Created December 12, 2015 23:08
Gets the folder where CS:GO is installed.
/// <summary>
/// Returns the location of the CS:GO installation, or null if it's unable to find it.
/// </summary>
/// <returns></returns>
private string GetCSGODir()
{
string steamPath = (string)Registry.GetValue("HKEY_CURRENT_USER\\Software\\Valve\\Steam", "SteamPath", "");
string pathsFile = Path.Combine(steamPath, "steamapps", "libraryfolders.vdf");
if (!File.Exists(pathsFile))
@moritzuehling
moritzuehling / GetCSGODir.cs
Created December 9, 2015 19:18
Finds the installation directory of CS:GO
private string GetCSGODir()
{
string steamPath = (string)Registry.GetValue("HKEY_CURRENT_USER\\Software\\Valve\\Steam", "SteamPath", "");
string pathsFile = Path.Combine(steamPath, "steamapps", "libraryfolders.vdf");
if (!File.Exists(pathsFile))
return null;
List<string> libraries = new List<string>();
https://docs.google.com/presentation/d/1A3IXVeWU1S9L52n3ISDvzQdAI6mStwv2Lhi6V67fYPg/edit?usp=sharing
@moritzuehling
moritzuehling / generateRandomID.js
Last active November 30, 2015 13:10
(Hopefully) generates a truly random ID-String. It should have an entropy of 6 * length bits. Browser support: IE11+, any other sane browser. ( http://caniuse.com/#search=crypto )
// my usage:
// var userId = generateRandomID(16) // 16 * 6 bits = 96 bits of entropy.
function generateRandomID(length) {
var cryptoObject = (window.crypto || window["msCrypto"]);
if (!cryptoObject || !cryptoObject.getRandomValues) {
throw "No supported cryptography-handler found!";
}
var base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
var array = new Uint8Array(length);