This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- mode: Emacs-Lisp; lexical-binding: t; -*- | |
;; Samuel Laurén 💗 2014-2015 | |
;; # TODO | |
;; - Support tags | |
(setq gc-cons-threshold 50000000) | |
(require 'cl-lib) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hacker News new comments | |
// @match *://news.ycombinator.com/item* | |
// @match *://hackerne.ws/item* | |
// @author Samuel Laurén | |
// @description Script for highlighting new comments on Hacker News | |
// ==/UserScript== | |
function findComments() { | |
return Array.prototype.slice.call(document.querySelector("table:nth-of-type(2)").querySelectorAll("table"), 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! AlignAssignments() range | |
let l:max = -1 | |
for n in range(a:firstline, a:lastline) | |
let l:line = getline(n) | |
let l:pos = match(line, "=") | |
if pos > max | |
let l:max = pos | |
endif | |
endfor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("wikipedia.org"), domain("wikibooks.org"), domain("wiktionary.org") { | |
.mw-headline, .firstHeading, #mw-content-text p, #mw-content-text>ul>li, #mw-content-text>ol>li { | |
font-family: "EB Garamond", Crimson, Georgia, serif !important; | |
text-rendering: optimizelegibility !important; | |
font-feature-settings: "kern", "liga", "dlig", "clig", "hlig", "calt"; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
CONFIG=$HOME/.config/nitrogen | |
SETS=$CONFIG/sets | |
function setWallpaper { | |
[ ! -f "$SETS/$1" ] && echo "Set \"$1\" does not exist" && return; | |
ln -f "$SETS/$1" "$CONFIG/bg-saved.cfg" | |
nitrogen --restore | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var addOne = function (x) { return x+1; }; | |
var church = function(n) { | |
if (n === 0) { | |
return function(fn) { | |
return function(x) { | |
return x; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Prelude hiding (Functor, Monad, (>>=), (>>), fmap) | |
import Data.Monoid (Monoid, mempty, (<>)) | |
class Functor f where | |
fmap :: (a -> b) -> f a -> f b | |
class Functor f => Applicative f where | |
pure :: a -> f a | |
(<*>) :: f (a -> b) -> f a -> f b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad (liftM, mapM, forever) | |
import Control.Monad.Loops (untilM_) | |
import Control.Concurrent (forkIO, threadDelay) | |
import Control.Concurrent.STM (atomically) | |
import Control.Concurrent.STM.TMVar (TMVar, newTMVar, swapTMVar, readTMVar) | |
import System.IO (hGetLine, hIsEOF, hFlush, Handle, stdin, stdout) | |
import System.Process (createProcess, shell, CreateProcess(..), StdStream(..)) | |
import System.Environment (getArgs) | |
import Data.Maybe (catMaybes) | |
import Data.List (nub) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Feedbin unread notifications | |
// @match *://feedbin.me/* | |
// @grant none | |
// @author Samuel Laurén | |
// ==/UserScript== | |
var count = () => { | |
var unreadCount = document.querySelector("[data-behavior~=all_unread] .count"); | |
return parseInt(unreadCount.innerHTML, 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name TYS Booking Calendar Limit Remover | |
// @namespace tysbookingnolimits | |
// @include http://booking.tys.fi/varaus/service/timetable/* | |
// @grant none | |
// ==/UserScript== | |
window.maxDate = null; |