Skip to content

Instantly share code, notes, and snippets.

@lattenwald
lattenwald / feedly.user.js
Last active August 29, 2015 14:06
My very own feedly enhance userscript: some style tweaks and loading of large Shorpy.com images into the feed.
// ==UserScript==
// @name Shorpy large images at Feedly
// @namespace q.alexander.feedly.shorpy
// @version 0.4
// @description Replace small Shorpy.com previews with large images in Feedly
// @match http://feedly.com/*
// @match https://feedly.com/*
// @copyright 2014+, Alexaner Q
// @grant none
// ==/UserScript==
@lattenwald
lattenwald / ap.navigation.user.js
Last active August 29, 2015 14:07
Apps list navigation for AndroidPolice userscript
// ==UserScript==
// @name Apps list navigation for AndroidPolice
// @namespace q.alexander.androidpolice.navigation
// @version 0.4
// @description enter something useful
// @author You
// @match http://www.androidpolice.com/*
// @grant none
// ==/UserScript==
@lattenwald
lattenwald / bigpicture.navi.user.js
Last active January 19, 2016 09:51
BigPicture navigation with keys j/k
// ==UserScript==
// @name BigPicture stuff
// @namespace q.alexander.bigpicture.navi
// @include http://www.bostonglobe.com/news/bigpicture/*
// @include https://www.bostonglobe.com/news/bigpicture/*
// @version 2.0
// @grant none
// ==/UserScript==
(function(){
@lattenwald
lattenwald / lepra.user.js
Last active August 29, 2015 14:12
Lepra
// ==UserScript==
// @name Lepra
// @namespace q.alexander.feedly.shorpy
// @version 0.2
// @description Miscellaneous improvements
// @match http://leprosorium.ru/*
// @match http://*.leprosorium.ru/*
// @match https://leprosorium.ru/*
// @match https://*.leprosorium.ru/*
// @copyright 2014+, Alexaner Q
@lattenwald
lattenwald / integralWith.hs
Created March 25, 2015 08:30
netwire integralWith' (integralWith, correction function has time (a -> a))
integralWith'
:: (W.HasTime t s, Fractional a)
=> (a -> a) -- ^ Correction function.
-> a -- ^ Integration constant (aka start value).
-> W.Wire s e m a a
integralWith' correct = loop
where
loop x' =
W.mkPure $ \ds dx ->
let dt = realToFrac (W.dtime ds)
@lattenwald
lattenwald / TriangleNumbers.hs
Last active August 16, 2016 08:36
Haskell triangle numbers
-- This is even slower than triangleNumsAlt, but this is exactly
-- THE function where I grocked lazy lists
triangleNums = map fst triangleNums'
where
triangleNums' = (1, 2) : map (\(n, i) -> (n+i, i+1)) triangleNums'
triangleNumsAlt = map (\i -> i * (i+1) `div` 2) [1..]
@lattenwald
lattenwald / adme.navi.user.js
Last active August 16, 2016 08:37
user-js adme.ru pictures navigation
// ==UserScript==
// @name Pictures navigation for Adme.Ru
// @namespace q.alexander.adme.navigation
// @version 0.1
// @description enter something useful
// @author You
// @match http://www.adme.ru/*
// @grant none
// ==/UserScript==
@lattenwald
lattenwald / builder-packages.user.js
Last active August 16, 2016 08:35
user-js buildmail:.dev.mail.ru Press "q" to get dialog with neatly formatted package names
// ==UserScript==
// @name Builder packet names
// @namespace q.alexander.mailru.builder
// @version 0.3
// @description enter something useful
// @author Alexander Q <qalexx@gmail.com>
// @match http://buildmail.dev.mail.ru/*
// @grant none
// ==/UserScript==
@lattenwald
lattenwald / Tree.purs
Last active August 16, 2016 08:36
purescript Solution of exercise 5 from "Purescript by example", chapter 10.19
module Tree where
import Prelude
import Data.Either
import Data.Foreign
import Data.Foreign.Class
data Tree a = Leaf a | Branch (Tree a) (Tree a)
newtype STree = STree