Skip to content

Instantly share code, notes, and snippets.

View folsen's full-sized avatar

Fredrik Harrysson folsen

View GitHub Profile
@folsen
folsen / gist:835233
Created February 19, 2011 18:08
test.tex.fleet
\documentclass[12pt]{article}
\usepackage{amsmath}
\title{\LaTeX}
\date{}
\begin{document}
\maketitle
\LaTeX{} is a document preparation system for the \TeX{}
typesetting program. It offers programmable desktop publishing
features and extensive facilities for automating most aspects of
typesetting and desktop publishing, including numbering and
@folsen
folsen / gist:1252103
Created September 29, 2011 22:21
Plotting password strength
% Word passwords
w = @(x) 20000.^x;
% Letter passwords (big and small letters a-Z)
l = @(x) 54.^x;
% Alphanumeric passwords (0-9 a-Z and !"#€%&/()=?_-)
an = @(x) 77.^x;
X = 0:20;
semilogy(X,w(X),'b',X,l(X),'r',X,an(X),'k')
@folsen
folsen / Main.hs
Created March 1, 2013 14:21
JSON backend using Happstack
{-# LANGUAGE DeriveDataTypeable, OverloadedStrings #-}
module Main where
import qualified Data.ByteString.Lazy.Char8 as L
import Control.Monad.IO.Class (liftIO)
import Control.Monad (msum, mzero)
import Data.Data (Data, Typeable)
import Data.Maybe (fromJust)
import Data.Aeson
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.ByteString.Lazy.Char8 (pack)
import Web.Scotty as S
import Network.Wai.Middleware.RequestLogger
import Data.Aeson
import Data.Aeson.Types
import Control.Lens hiding ((.=), (??))
data TypeOne = TypeOne T.Text TypeTwo TypeThree
deriving (Show)
data TypeTwo = TypeTwo Double
deriving (Show)
data TypeThree = TypeThree Double
deriving (Show)
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
import qualified Data.HashMap.Strict as HashMap
import Data.Data
import Data.HashMap.Strict (HashMap)
import qualified Data.Vector as Vector
import Data.Vector (Vector)
import Data.Generics.Uniplate.Data
import GHC.Generics
#![feature(phase)]
#[phase(plugin)]
extern crate regex_macros;
extern crate regex;
use std::io::Command;
use std::fmt;
struct Process {
pid : String,
// This works:
let comma = satisfy(|c| c == ',');
let mut args = sep_by(word, satisfy(|c| c == ',')).skip(comma);
// But this doesn't
let comma = satisfy(|c| c == ',');
let mut args = sep_by(word, comma).skip(comma);

Notes from DHH RailsConf Keynote 2015

monolith vs integrated system - i really hope integrated system doesn't catch on, sooo buzzwordy :P if you like monoliths you should just be proud of that and be able to defend it and say monolith

monoliths vs bad software - I totally agree that there's nothing inherently wrong in monoliths and the term of derision usually just means "this is bad software"

while talking about monoliths I'm really sad he didn't actually address the fact that 99% of Rails apps become unmanageable and unmaintainable after a year of development, yeah it's bad software, but why does almost all Rails software become bad and what can we do about it?

it's not going to become better by making 10 bad applications - the reality is that in most cases it does become better because now you have years worth of more knowledge of your domain and rewriting the software from scratch you bake all that knowledge in, you could've rewritten your mono

Keybase proof

I hereby claim:

  • I am folsen on github.
  • I am folsen (https://keybase.io/folsen) on keybase.
  • I have a public key whose fingerprint is DC62 FEB0 EBA7 425C C5D3 7385 4846 3E0D F0B0 94AE

To claim this, I am signing this object: