This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Prevent a commit when no ticket reference is in the message. | |
# By hooking in just before an actual commit | |
# To install: | |
# cd path/to/repo/ | |
# wget --no-clobber https://gist.githubusercontent.com/EmileSonneveld/787b8b51e55027cf848223bc30546dd8/raw -O .git/hooks/commit-msg && chmod +x .git/hooks/commit-msg | |
check=$(grep -E 'Merge (branch|remote-tracking branch|pull request|tag) ' "$1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import datetime | |
import openeo | |
connection = openeo.connect("openeo.cloud").authenticate_oidc() | |
now = datetime.datetime.now() | |
print(connection.root_url + " time: " + str(now)) | |
precipitation_dc = connection.load_collection( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collada | |
import numpy as np | |
class DrawCollada: | |
def __init__(self): | |
self.mesh = collada.Collada() | |
self.scene_nodes = [] | |
self.counter = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This illustrates that serialising to JSON loses information. | |
var obj = { | |
ref1: {foo:"bar"}, | |
} | |
obj.ref2 = obj.ref1 | |
console.log(obj) | |
obj.ref2.foo = "changed" | |
console.log(obj) // both changed | |
obj2 = JSON.parse(JSON.stringify(obj)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!r6rs | |
(import (rnrs arithmetic bitwise (6)) | |
(rnrs base (6)) | |
(rnrs control) | |
(rnrs io simple (6)) | |
) | |
; url-encode implemented in scheme, r6rs | |
; Behaves more-or-less the same as the JavaScript equivalent decodeURIComponent() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Security; | |
using System.Security.AccessControl; | |
namespace GCAWeb.Utils | |
{ | |
/// <span class="code-SummaryComment"><summary> | |
/// Configuring a Web site through a Web interface can be tricky. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
# python sound_hash.py c6951a1048d39d28610d491cb10f2b12d4169c02 | |
import wave, base64, struct, random, sys, os, math; | |
import subprocess, re |