Skip to content

Instantly share code, notes, and snippets.

@CHH
CHH / atincometax.js
Created July 9, 2014 13:01
Google Apps Script for adding a Sheets function for estimating the austrian income tax
function atincometax(income) {
var url = "http://chh-at-tax.herokuapp.com/income-tax";
income = parseInt(income, 10);
var response = UrlFetchApp.fetch(url, {
method: "post",
payload: JSON.stringify({income: income})
});

Keybase proof

I hereby claim:

  • I am CHH on github.
  • I am chh (https://keybase.io/chh) on keybase.
  • I have a public key whose fingerprint is F6E8 DB92 D268 19A8 18BF EA8F 551C 6B7C FF55 E3C7

To claim this, I am signing this object:

<html>
<body>
<title>Ein Kontaktformular</title>
<?php
echo "<b><br>Projekt: Hello World";
$Vorname="Florian";
$Nachname="Hrubicek";
echo "<b><br>Name: $Vorname $Nachname";
$Adresse="Holzing 6";
$PLZ="3300 Winklarn,";
<?php
class LoginForm extends Szene1_Html_Form
{
/**
* Schablonenmethode, wird von parent::__construct() aufgerufen
*/
public function init()
{
$this->setAction("/login");
@CHH
CHH / function_currying.php
Created December 6, 2010 12:10
Prefill the arguments of functions (Currying)
<?php
function func_curry($fn)
{
$args = array_slice(func_get_args(), 1);
return function() use ($fn, $args) {
$args = array_merge($args, func_get_args());
return call_user_func_array($fn, $args);
};
@CHH
CHH / function_wrapping.php
Created December 6, 2010 12:21
Wrap a function inside another function
<?php
function func_wrap($fn, $wrapper)
{
// Unify calling of the wrapped function
if(is_array($fn) or is_string($fn)) {
$original = function() use ($fn) {
return call_user_func_array($fn, func_get_args());
};
} else {
<?php
// pipes each function's return value as input into the next function in the chain
function func_compose()
{
$fns = func_get_args();
$composition = function() use ($fns) {
$input = func_get_args();
foreach ($fns as $fn) {
$return = call_user_func_array($fn, $input);
https://yoursvnserver.example.com/framework lib/framework
https://someotherlibrary.example.com/framework lib/other_framework
@CHH
CHH / browserid.php
Created September 28, 2011 11:39
PHP BrowserID verification function
<?php
/**
* Verifies the given BrowserID assertion
*
* @throws \UnexpectedValueException on error
*
* @param string $assertion Assertion provided by navigator.id.getVerifiedEmail()
* @param string $audience Host Name, defaults to $_SERVER['HTTP_HOST']
* @param string $verifyService URL of the verification webservice, defaults BrowserID's
@CHH
CHH / git-flow-feature-build
Created February 3, 2012 11:07
git-flow-feature-build
#!/usr/bin/env bash
# The most important line in every Shell Script.
set -e
JENKINS_USER="$(git config --get jenkins.username)"
JENKINS_PASSWORD="$(git config --get jenkins.password)"
if [ -n "$2" ]; then
JENKINS_JOB="$2"