Skip to content

Instantly share code, notes, and snippets.

View ptomasroos's full-sized avatar

Tomas Roos ptomasroos

View GitHub Profile
@SteveSongMIT
SteveSongMIT / captainflint.dtl
Created March 20, 2012 22:50
Simple Cowboy web server + ErlyDTL
<html>
<body>
GET squawk:<br />
{{ squawk_get }}<br /><br />
POST squawk:<br />
{{ squawk_post }}<br /><br />
@haf
haf / gist:4423968
Last active December 10, 2015 10:49
A pre-draft, happy-new-year, proposal for Inconsistency Roboustness 2014
Inconsistency Roboustness in Software Systems of the Future
It is a known fundamental problem to the people who do programming
for a living, that languages do not match the nature of the universe in which
those languages compute. Computer languages are based a rather romantic notion
of sequential processing that is not in line with how the real world operates;
the real world operates in a continuoum of space-time with multiple concurrent
threads of reality always ongoing, being acted upon by actors.
As such we must strive to model our information systems and programming
@drunkcod
drunkcod / gist:4488313
Last active December 10, 2015 20:28
a rough but workable way to "inject" contract tests into a NUnit fixture
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace NUnitBehavesLike
{
public interface IThingamabob
{
@tinabeans
tinabeans / template.html
Last active February 13, 2024 09:18
A super-barebones single-column responsive email template, assuming a max-width of 540px. Read about it on the Fog Creek blog.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Single-Column Responsive Email Template</title>
<style>
@media only screen and (min-device-width: 541px) {
.content {
@fjavieralba
fjavieralba / KafkaLocal.java
Last active March 23, 2021 09:57
Embedding Kafka+Zookeeper for testing purposes. Tested with Apache Kafka 0.8
import java.io.IOException;
import java.util.Properties;
import kafka.server.KafkaConfig;
import kafka.server.KafkaServerStartable;
public class KafkaLocal {
public KafkaServerStartable kafka;
public ZooKeeperLocal zookeeper;
@gitaarik
gitaarik / git_submodules.md
Last active November 16, 2024 19:55
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
import serial
class Lifespan(object):
def __init__(self):
self.connect()
def connect(self):
self.port = serial.Serial('/dev/tty.IHP-Serialport', 19200, timeout=1)
while self.port.read(1) != '':
@michaljemala
michaljemala / tls-client.go
Last active November 12, 2024 23:20
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@kachayev
kachayev / concurrency-in-go.md
Last active August 22, 2024 14:20
Channels Are Not Enough or Why Pipelining Is Not That Easy