Skip to content

Instantly share code, notes, and snippets.

View cstrahan's full-sized avatar

Charles Strahan cstrahan

  • Backtrace
  • Dallas, TX
View GitHub Profile
@cstrahan
cstrahan / w3m_resizing.patch
Created December 31, 2015 22:44 — forked from fmthoma/w3m_resizing.patch
Fix semi-transparent artifacts in w3m-img when used with 32-bit color (e.g. urxvt)
diff --git a/w3mimg/x11/x11_w3mimg.c b/w3mimg/x11/x11_w3mimg.c
index d24213e..c534393 100644
--- a/w3mimg/x11/x11_w3mimg.c
+++ b/w3mimg/x11/x11_w3mimg.c
@@ -378,6 +378,10 @@ x11_load_image(w3mimg_op * self, W3MImage * img, char *fname, int w, int h)
w = imlib_image_get_width();
if (h <= 0)
h = imlib_image_get_height();
+
+ im = imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), w, h);
@cstrahan
cstrahan / Categories.hs
Created January 30, 2016 02:05 — forked from ekmett/Categories.hs
UndecidableSuperClasses test case
{-# language KindSignatures #-}
{-# language PolyKinds #-}
{-# language DataKinds #-}
{-# language TypeFamilies #-}
{-# language RankNTypes #-}
{-# language NoImplicitPrelude #-}
{-# language FlexibleContexts #-}
{-# language MultiParamTypeClasses #-}
{-# language GADTs #-}
{-# language ConstraintKinds #-}
@cstrahan
cstrahan / profunctorlens.hs
Created February 14, 2016 05:29 — forked from sjoerdvisscher/profunctorlens.hs
Pure profunctor lenses
{-# LANGUAGE Rank2Types #-}
import Control.Applicative (Applicative(..), (<$>), Const(..))
import Control.Lens.Internal.Review (Reviewed(..))
import Control.Lens.Internal.Bazaar (Bazaar(..))
import Data.Monoid (Monoid(..), First(..))
import Data.Profunctor
import Data.Profunctor.Rep
import Data.Functor.Identity
@cstrahan
cstrahan / VLPipes.hs
Created February 16, 2016 04:20 — forked from sjoerdvisscher/VLPipes.hs
Van Laarhoven pipes
{-# LANGUAGE RecordWildCards #-}
import Control.Monad
import Control.Monad.Trans.Class
import Data.Void
data ProxyOps a' a b' b m = Ops { req :: a' -> m a, resp :: b -> m b' }
newtype Proxy a' a b' b m r = Proxy { runProxy :: ProxyOps a' a b' b m -> m r }
run :: ProxyOps a' a b' b m -> Proxy a' a b' b m r -> m r
@cstrahan
cstrahan / emacs-24.5-24bit.diff
Last active February 15, 2017 03:49 — forked from choppsv1/emacs-24.4-24bit.diff
True color (24-bit) terminal support for Emacs 24.5
This is a modified version of the patch found here:
https://gist.github.com/choppsv1/36aacdd696d505566088
Which itself is a modified version of:
http://emacs.1067599.n5.nabble.com/RFC-Add-tty-True-Color-support-tt299962.html
To use true-color, use the flag --color=true-color.
Alternatively, set the EMACS_TRUE_COLOR_SEPARATOR environment variable to
either ':' or ';'.
@cstrahan
cstrahan / gist:62966e1673db4fbb0975
Created February 28, 2016 23:25 — forked from nkpart/gist:cc852b43d948a33a04c8
Using ghcid inside of emacs
Pieces you need:
* emacs
* ghcid
ghcid needs to know the height of the terminal, we'll set it explicitly
height = (window-height) - (scroll-margin) - 1
set this height as your term-buffer-maximum-size
@cstrahan
cstrahan / Pcbt.hs
Created February 29, 2016 22:08 — forked from pchiusano/Pcbt.hs
Prioritized critical bit tree data structure
{-# Language TypeFamilies #-}
module Pcbt where
import Prelude hiding (lookup)
import Data.Set (Set)
import Data.Map (Map)
import qualified Data.Set as Set
import qualified Data.Map.Strict as Map
import Data.Maybe
@cstrahan
cstrahan / profunctors.lhs
Created March 1, 2016 20:50 — forked from bennofs/profunctors.lhs
Profunctor lenses
Profunctor lenses
=================
First, we enable the RankNTypes extension which gives us 'forall' and also import some modules:
> {-# LANGUAGE RankNTypes #-}
> module ProfunctorLenses where
> import Data.Profunctor
> import Data.Tagged
> import Data.Bifunctor
@cstrahan
cstrahan / Categories.hs
Last active December 19, 2025 13:54 — forked from ekmett/Categories.hs
{-# language KindSignatures #-}
{-# language PolyKinds #-}
{-# language DataKinds #-}
{-# language TypeFamilies #-}
{-# language RankNTypes #-}
{-# language NoImplicitPrelude #-}
{-# language FlexibleContexts #-}
{-# language MultiParamTypeClasses #-}
{-# language GADTs #-}
{-# language ConstraintKinds #-}
@namespace html url(http://www.w3.org/1999/xhtml);
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/*
Author: Twily
Description: Minimal flat styled tabs for Australis
Compitability: Firefox Nightly v31.0a1 - v32.0a1 (Australis)
CSS Variables were introduced to Firefox in v29.0a1
Website: http://twily.info/