Skip to content

Instantly share code, notes, and snippets.

@chrisdone
chrisdone / gist:dec52a5995290bab5d27
Created September 11, 2014 12:32
grooveshark broadcast tracks
// ==UserScript==
// @name Grooveshark broadcast tracks
// @namespace chrisdone
// @description Grooveshark broadcast tracks
// @include http://grooveshark.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @version 1
// @grant none
// ==/UserScript==
-- Compile with
--
-- ghc --make Status.hs -o ~/.cabal/bin/projects -O2 -threaded
--
-- Or run with:
--
-- runhaskell Status.hs
--
import Control.Applicative
import Data.Conduit.Shell
import qualified Data.Conduit.Shell.Segments as SH
main =
run (do hsenv
cur:_ <- SH.strings latestStackage
sed ("s/remote-repo:.*/remote-repo: stackage:http:\\/\\/www.stackage.org\\/stackage\\/" ++
cur ++ "/")
".hsenv/cabal/config"
"-i"
@chrisdone
chrisdone / Keylogger.hs
Last active August 29, 2015 14:08
Keylogger
-- Simple keylogger
--
-- Compile & install
--
-- ghc --make Keylog.hs -O2 -threaded -o xinput-keylogger
-- sudo mv xinput-keylogger /usr/local/bin
--
-- Storage (for security)
--
-- $ sudo useradd xinput
foo = [Extender moduleHead,Extender exportList]
-- everything after is messed up
indentSpaces = putStrLn = "Hello!"
@chrisdone
chrisdone / kmacro-start-macro-resuming-recent.el
Last active August 29, 2015 14:08
Keyboard macros resumable after C-g
;;; kmacro.el --- Enhancement to kmacro recording.
;; Copyright (c) 2014 Chris Done. All rights reserved.
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
import Data.Conduit.Shell
import qualified Data.Conduit.Shell.Segments as SH
import System.Environment
main =
do args <- getArgs
case args of
[user] ->
do pos:_ <- run (SH.strings (posConduit user))
putStrLn pos
;; Simple interactive work tracker similar to timeclock.el.
;;
;; Chris Done 2009, Public domain
;;
;; Suggested setup:
;; ;; Work tracker
;; (require 'worktracker)
;; ;;; Clock into project
;; (global-set-key [f9] 'work-clockin)
;; ;;; Clock out of project (done)
;; Align the import lines in a Haskell file.
;; Copyright (C) 2010 Chris Done <chrisdone@gmail.com>
;; This module is intended for Haskell mode users, but is
;; independent of Haskell mode.
;; Example usage:
;; (require 'haskell-align-imports)
;; (define-key haskell-mode-map (kbd "C-c ." 'haskell-align-imports)
if exists('b:did_my_haskell_plugin')
finish
endif
let b:did_my_haskell_plugin = 1
so <sfile>:h/program.vim
setl isk+=' et sts=4 sw=4
setl nospell