Skip to content

Instantly share code, notes, and snippets.

View fromheten's full-sized avatar

Martin Josefsson fromheten

View GitHub Profile
@fromheten
fromheten / Decaf Coffee.md
Created July 22, 2023 14:12
Caffeine contents in decaf vs "normal" coffee

Caffeine Content of Decaffeinated Coffee

Sample # Store Type/Brand Caffeine Dose (mg/16 USA fl. oz) Caffeine Dose (mg/100 ml)
D1 The Big Bean Brewed, blended 10.1 2.135
D2 The Big Bean Brewed, Italian Roast, Country Origin Colombia 10.6 2.24
D3 Starbucks Brewed 8.6 1.82
D4 Royal Farms Brewed 8.6 1.82
D5 Dunkin' Donuts Brewed 10.1
@fromheten
fromheten / 90-min-scc.scm
Created September 4, 2019 08:18 — forked from nyuichi/90-min-scc.scm
The 90 Minute Scheme to C Compiler
#!/usr/local/Gambit-C/bin/gsi
; Copyright (C) 2004 by Marc Feeley, All Rights Reserved.
; This is the "90 minute Scheme to C compiler" presented at the
; Montreal Scheme/Lisp User Group on October 20, 2004.
; Usage with Gambit-C 4.0:
;
; % ./90-min-scc.scm test.scm
@fromheten
fromheten / Hiccup-like rendering of React elements
Created September 1, 2017 08:35
Hiccup-like rendering of React elements
function martinRender (e) {
if (Array.isArray(e[2])) {
return martinRender(e[2])
} else {
return React.createElement.apply(this, e)
}
}
@fromheten
fromheten / gist:2c7e930a6b1170bc8c15
Created October 20, 2014 23:01
Late night thinking about
Late night thoughts
<!-- html -->
<html>
<head>
<title>Website compiled from JSON</title>
</head>
<body>
<h1>This is a title</h1>
<p>This paragraph is interesting</p>
<?php
$pathBase = '/var/mp3/Tales';
$urlBase = '/music/Tales';
// dirToArray
// $pathBase : A directory to decend down from
// $pathCurrent : this function meant to be run recursice, give an empty
@fromheten
fromheten / gist:6716730
Created September 26, 2013 16:35
Martin's tips for newcomer programmers in Berlin as of 2013/september

My friend Xaviers brother is moving to Berlin. Fun! This is a list of places that are of interest for programmers.

  • Meetup.com => go there, look for meetups on things you're interested in. Head on there with a laptop and talk to people. There's always someone with a cool project who needs a helping hand.

  • [http://berlinstartupjobs.com/](Berlin startup jobs)

  • Important to know is that jobs are given to friends, so make friends with people in startups. If you know you can trust someone as a friend, then it's easier to trust them as a coworker.

  • Put an ad up in the co-working spaces. Betahaus, Mobilesuite, Co-up etc.

@fromheten
fromheten / Passwords
Created May 2, 2013 23:38
Long passwords
require 'rubygems'
require 'clipboard'
if ARGV[0] === nil
leng = 500
else
leng = ARGV[0]
end
def create_password(pwdlen)
@fromheten
fromheten / gist:5506263
Created May 2, 2013 23:35
ö-language, ruby
#!/usr/bin/env ruby
# encoding: UTF-8
# Ö-språket by Martin Josefsson
# A cli app to translate from any language into the Ö-language, the native
# tounge of my people.
print "Wölcömö tö thö öntöröctövö Ö-sprököt trönslötör.\nWhöt shööld Ö trönslötö?\n\nRömömbör, ^c öxöts thö prögröm.\n"
def translate
@fromheten
fromheten / gist:5506236
Created May 2, 2013 23:31
The Ö-language translator. Very festive
<!DOCTYPE html>
<head>
<title>Öntöröktöv ö-sprökötövörsöttörö</title>
<!-- Google web font API -->
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ubuntu">
<style type="text/css">
body {
text-align: center;
font-size: 20px;
font-family: Ubuntu, sans-serif, Arial, Helvetica;
@fromheten
fromheten / deardiary.rb
Created July 2, 2012 01:27
Dear diary - what is wrong?
#/usr/bin/env ruby
# encoding: UTF-8
######
# Dear diary
# Created by Martin Josefsson, fromhet@github
# Licenced under the lastest GPL there is
######
require 'encryptor'