Skip to content

Instantly share code, notes, and snippets.

View passy's full-sized avatar
😷
Wear a mask.

Pascal Hartig passy

😷
Wear a mask.
View GitHub Profile
Verifying my Blockstack ID is secured with the address 18Uquf8bAjtNmV3DeTccAWpZZrVzG6Ba6E https://explorer.blockstack.org/address/18Uquf8bAjtNmV3DeTccAWpZZrVzG6Ba6E
commit 9957e3b5fae1cd14a7173811253dc11769729869
Author: Pascal Hartig <phartig@rdrei.net>
Date: Wed Oct 25 10:00:42 2017 +0100
Remove now redundant @JvmStatic
diff --git a/sample-kotlin/src/main/java/com/fblitho/lithoktsample/lithography/components/FavouriteButtonSpec.kt b/sample-kotlin/src/main/java/com/fblitho/lithoktsample/lithography/components/FavouriteButtonSpec.kt
index 7a1178d20..9822060da 100755
--- a/sample-kotlin/src/main/java/com/fblitho/lithoktsample/lithography/components/FavouriteButtonSpec.kt
+++ b/sample-kotlin/src/main/java/com/fblitho/lithoktsample/lithography/components/FavouriteButtonSpec.kt

I had a fun refactoring example in Haskell today I wanted to share. So, I've got a structure with a nested Maybe inside, which looked like this:

Maybe (Vector.Vector (Maybe (Direction, [Departure])))

I wanted to get that second-level Maybe folded into the first as it didn't provide any semantic meaning. So I start by writing the type definition:

public class TestClass {
public static void main(String... args) {
new Inner();
}
// Private class, package-level constructor.
private static class Inner {
Inner() {
System.out.println("Hello, world.");
}
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/root_view" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.facebook.slingshot.mypeople.PeopleView android:id="@id/people_shots_view" android:background="@color/black" android:visibility="visible" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<com.facebook.slingshot.camera.CameraShotsView android:id="@id/camera_shots_view" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<com.facebook.slingshot.preview.PreviewShotsView android:id="@id/preview_shots_view" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<com.facebook.slingshot.viewer.ViewerShotsView android:id="@id/viewer_shots_view" android:layout_width="fill_parent" android:layout_height="fill_parent" />
<com.facebook.slingshot.preview.PreviewShotsView android:id="@id/reaction_preview_shots_view" android:lay
@passy
passy / Core.hs
Created September 1, 2014 16:08
Core.hs
type CoreExpr = Expr Var
data Expr b -- "b" for the type of binders,
= Var Id
| Lit Literal
| App (Expr b) (Arg b)
| Lam b (Expr b)
| Let (Bind b) (Expr b)
| Case (Expr b) b Type [Alt b]
| Cast (Expr b) Coercion
@passy
passy / todomvc-inline-false.html
Last active August 29, 2015 14:05
vulcanized todomvc
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><title>TodoMVC</title><meta name="description" content="Helping you select an MV* framework - Todo apps for Backbone.js, Ember.js, AngularJS, Spine and many more"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="TodoMVC"><meta name="twitter:site" content="@TasteJS"><meta name="twitter:description" content="Helping you select an MV* framework - Todo apps for Backbone.js, Ember.js, AngularJS and many more"><meta name="twitter:image" content="https://raw.githubusercontent.com/tastejs/todomvc/gh-pages/site-assets/screenshot.png"><meta property="og:url" content="http://todomvc.com"><meta property="og:title" content="TodoMVC"><meta property="og:image" content="https://raw.github.com/tastejs/todomvc/gh-pages/site-assets/screenshot.png"><meta property="og:description" content="Helping you select an MV* framework - Todo apps for Backbone.js, Ember.js, AngularJS,
@passy
passy / hi.hs
Last active August 29, 2015 14:05
{-# LANGUAGE OverloadedStrings #-}
import Text.LaTeX
main :: IO ()
main =
execLaTeXT simple >>= renderFile "yo.tex"
-- Execute pdflatex
simple :: Monad m => LaTeXT_ m
simple = do
@passy
passy / renderlatex.hs
Created August 22, 2014 23:37
renderlatex.hs
import Text.LaTeX
main = (execLaTeXT $ document $ raw "Hello \\textbf{World}") >>= renderFile "yo.tex"
@passy
passy / h5bp.js
Last active August 29, 2015 14:04 — forked from sindresorhus/h5bp.js
document.write("<!DOCTYPE html>");
document.write("<!--[if lt IE 7]> <html class=\"no-js lt-ie9 lt-ie8 lt-ie7\"> <![endif]-->");
document.write("<!--[if IE 7]> <html class=\"no-js lt-ie9 lt-ie8\"> <![endif]-->");
document.write("<!--[if IE 8]> <html class=\"no-js lt-ie9\"> <![endif]-->");
document.write("<!--[if gt IE 8]><!--> <html class=\"no-js\"> <!--<![endif]-->");
document.write(" <head>");
document.write(" <meta charset=\"utf-8\">");
document.write(" <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">");
document.write(" <title><\/title>");
document.write(" <meta name=\"description\" content=\"\">");