Skip to content

Instantly share code, notes, and snippets.

@salzig
salzig / app.cs
Last active May 12, 2019 15:05
Stupid Ring Linked List in C#
// Prints: (anker) C <- B <- A <- C <- B <- A
using System;
public class Program
{
public static void Main()
{
Ring ring = new Ring();
ring.prepend("B");
@salzig
salzig / notification
Last active March 28, 2018 12:05
Send OSX Notifications from Terminal or Script via Simple OSAScript
#!/usr/bin/osascript
# Place this Script in any of this `echo -e ${PATH//:/'\n'}` directories and make sure to `chmox +x notification`
# Usage:
# notification "Hello World"
# or
# notification Hello World
on run argv
set AppleScript's text item delimiters to space
#!/bin/bash
FIFO_FILE=factorio.fifo
PID_FILE=factorio.pid
if [ ! -p $FIFO_FILE ]; then
mkfifo $FIFO_FILE
fi
echo $$ > $PID_FILE
@salzig
salzig / _.md
Created June 2, 2013 15:55
HAW - Next Media - Tile Rechnerei
@salzig
salzig / _.md
Created May 22, 2013 09:58
minimal d3 area chart
@salzig
salzig / README.md
Last active December 16, 2015 05:19
TideSDK 1.3.1 http://test262.ecmascript.org/ Example Application

TideSDK 1.3.1 http://test262.ecmascript.org/ Example Application

  • Start Application
  • Click on "Run"
  • Click on "Run" right next to "Chapter - ch15 (8075 tests)"
@salzig
salzig / DES.java
Created November 12, 2012 21:34
Finde den Fehler O.o
// Copyright (C) 1998-2001 Logi Ragnarsson
import java.util.Random;
/**
* This is the class for Data Encryption Standard (DES) keys. See FIPS PUB 46-1
* or DEA defined in ANSI X3.92-1981 for a complete specification.
*
* <p>
* DES is the most widely used block cipher, although it is nowadays normally
@salzig
salzig / caja.rb
Created November 6, 2012 17:21
Kleiner en/de-coder für Caja
# coding: utf-8
# Beispiel:
# > Caja.encode("Hallo Welt, es ist 13 Uhr")
# > Caja.decode(Caja.encode("Hallo Welt, es ist 13 Uhr"))
class Caja
@@table = {
"a" => "¥¥µ",
"h" => "þµ¥",
@salzig
salzig / gist:3636465
Created September 5, 2012 13:24
Oh why? O.o
> a = Hash.new(Hash.new(0))
=> {}
> a[DateTime.now.beginning_of_day]["abc"] = 13
=> 13
> a[DateTime.now.beginning_of_day]["abc"]
=> 13
> a[DateTime.now.beginning_of_day]
@salzig
salzig / time.scala
Created April 25, 2012 08:48
Scala Time
package time
object App {
def main(args:Array[String]) {
import TimeImplicit._
println(10 ns)
println(20 µs)
println(30 ms)
println(40 s)