THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| commit 8e51c34ca4d97e48750850d5ba09956f89783b4e | |
| Author: Kyle Kingsbury <aphyr@aphyr.com> | |
| Date: Wed May 7 19:06:15 2014 -0700 | |
| Improve Keyword.intern performance | |
| Keyword interning is an expensive factor in many Clojure | |
| serialization/deserialization paths, especially where the same set of | |
| keywords are created and freed repeatedly; e.g. iterating over records | |
| with similar structure. There are two principle costs to keyword |
| {-# LANGUAGE TypeFamilies, GADTs, DataKinds, TypeOperators, FlexibleInstances, OverlappingInstances, ConstraintKinds, MultiParamTypeClasses, ForeignFunctionInterface #-} | |
| import Control.Applicative | |
| import Foreign | |
| import Foreign.C | |
| -- heterogenous list | |
| data HList (ts :: [ * ]) where | |
| E :: HList '[] | |
| (:.) :: t -> HList ts -> HList (t ': ts) |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| {-# LANGUAGE RankNTypes #-} | |
| import Data.Foldable | |
| import Data.Monoid | |
| newtype M a = M { getM :: forall m. Monoid m => (a -> m) -> m } | |
| instance Monoid (M a) where | |
| mempty = M $ const mempty | |
| x `mappend` y = M $ \f -> getM x f `mappend` getM y f |
| RUSTC = rustc | |
| RUSTFLAGS = | |
| .PHONY : all | |
| all: something | |
| # create something's targets | |
| $(eval $(call CRATE_LIB_TARGET, lib.rs)) | |
| # helper function to create crate targets for libraries |
| require 'rblineprof' | |
| module Rblineprof | |
| module ConsoleHelpers | |
| include Rblineprof::Helpers | |
| def lineprof_block(options = {}, &block) | |
| profile = lineprof(rblineprof_profiler_regex(options[:lineprofiler])) do | |
| ret = yield | |
| end |
| function errexit() { | |
| local err=$? | |
| set +o xtrace | |
| local code="${1:-1}" | |
| echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err" | |
| # Print out the stack trace described by $function_stack | |
| if [ ${#FUNCNAME[@]} -gt 2 ] | |
| then | |
| echo "Call tree:" | |
| for ((i=1;i<${#FUNCNAME[@]}-1;i++)) |
| {-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances, | |
| OverloadedStrings #-} | |
| import Data.Monoid (Monoid(..), (<>)) | |
| import Data.String (IsString(..)) | |
| import Data.Text (Text) | |
| import Data.Text.Lazy.Builder (Builder, singleton) | |
| import qualified Data.Text.Lazy.Builder as Bld | |
| import qualified Data.Text.Lazy.Builder.Int as Bld |
| hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg | |
| cd /tmp | |
| hdiutil convert /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg -format UDRW -o /tmp/RWBase | |
| hdiutil convert -format UDSP -o /tmp/sparseRWBase RWBase.dmg | |
| rm /tmp/RWBase.dmg | |
| hdiutil resize -size 6g /tmp/sparseRWBase.sparseimage | |
| hdiutil attach -owners on /tmp/sparseRWBase.sparseimage -shadow | |
| sudo rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages | |
| sudo ditto /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation/Packages | |
| hdiutil eject /Volumes/OS\ X\ Install\ ESD/ |