Skip to content

Instantly share code, notes, and snippets.

View laszlokorte's full-sized avatar

Laszlo Korte laszlokorte

View GitHub Profile
'use strict';
var isArray = require('x-is-array');
// START Cycle.js-specific code >>>>>>>>
var h = require('@cycle/dom').h;
// END Cycle.js-specific code <<<<<<<<<<
var SVGAttributeNamespace = require('virtual-dom/virtual-hyperscript/svg-attribute-namespace');
var attributeHook = require('virtual-dom/virtual-hyperscript/hooks/attribute-hook');
@laszlokorte
laszlokorte / Material-Theme-Lighter.sublime-theme
Last active November 29, 2015 12:19
Some color and spacing adjustments
[
{
"class": "sidebar_label",
"color": [135, 145, 165],
},
{
"class": "sidebar_label",
"parents": [{"class": "tree_row", "attributes": ["expandable"]}],
"color": [145, 165, 175],
<?php
file_put_contents(__DIR__ . '/test.txt', "Hello World");
?>
#lang racket
(define (anfangskurs A B D)
(define alpha (my-acos (/ (- (sin B) (* (cos D) (sin A))) (* (cos A) (sin D)))))
(cond
[(< 180 alpha) (- 360 alpha) alpha]))
#lang racket
(define (degree->cardinal degree)
(case (modulo (inexact->exact (round (* 32 (/ degree 360)))) 32)
((0) "N")
((1) "NbE")
((2) "NNE")
((3) "NEbN")
((4) "NE")
((5) "NEbE")
#lang racket
(define (helper dir1 dir2 sub)
(cond
[(= sub 1) dir1]
[(= (modulo sub 4) 0) (string-append "b" dir1)]
[(= (modulo sub 2) 0) (string-append "b" dir2)]
))
(define directions "NESESWNW")
@laszlokorte
laszlokorte / gist:3941116
Created October 23, 2012 19:47
Uni Hamburg - SE3-Übung #1 2012
#lang racket
(define (degree->radian degree)
(* (/ (* 2 pi) 360) degree))
(define (radian->degree radian)
(* (/ 360 (* pi)) radian))
(define (my-acos alpha)
(if (= alpha 0)
@laszlokorte
laszlokorte / trait.php
Created July 23, 2011 19:24
Is this possible in php 5.4 with the new traits feature?
<?php
/**
* Is this possible in php5.4 using traits?
*/
trait Hashmap {
public function set($key, $val) {
$this->data[$key] = $val;
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
@laszlokorte
laszlokorte / gist:760242
Created December 30, 2010 20:18
TinyMCE fix for leaving definition-lists with the enter key
setup : function(ed) {
ed.onKeyPress.addToTop(function(ed, e) {
if(e.keyIdentifier =='Enter' && ed.selection)
{
var element = ed.selection.getNode(),
tagname = element.tagName.toLowerCase(),
contentLength = element.textContent.length;
if( contentLength==0 && (tagname=='dt' || tagname=='dd'))
{
ed.execCommand("formatBlock",false, 'p');