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
| module Main (main) where | |
| -- http://tools.ietf.org/html/rfc5952 | |
| import Data.Word (Word64) | |
| import Data.Bits ((.|.), (.&.), shiftL, shiftR) | |
| import Data.Maybe (listToMaybe) | |
| import Numeric (showHex) | |
| import Data.List (intercalate, isInfixOf) | |
| import Data.List.Split (splitOn) |
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
| Index: awk.1 | |
| =================================================================== | |
| --- awk.1 (revision 270781) | |
| +++ awk.1 (working copy) | |
| @@ -208,7 +208,7 @@ | |
| if no argument. | |
| .TP | |
| .B rand | |
| -random number on (0,1) | |
| +random number on [0,1) |
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.Applicative (Applicative(..)) | |
| import Control.Monad (ap) | |
| data MyIO a = Return a | |
| | Get (String -> MyIO a) | |
| | Put String (MyIO a) | |
| instance Functor MyIO where | |
| fmap f (Return a) = Return (f a) | |
| fmap f (Get g) = Get (fmap f . g) |
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/perl | |
| use strict; | |
| use warnings; | |
| my $argv = join ' ', @ARGV; | |
| if (index($argv, '-E')+1 && index($argv, '-undef')+1 && index($argv, '-traditional')+1) { | |
| $argv =~ s/-x c/-x assembler-with-cpp/g; | |
| @ARGV = split ' ', $argv; |
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
| {-# LANGUAGE BangPatterns #-} | |
| import Data.Bits | |
| import Data.Char (ord) | |
| import Data.Maybe (fromMaybe, listToMaybe) | |
| import Numeric (showHex) | |
| import Network.Browser | |
| import Network.HTTP | |
| import System.Environment (getArgs) | |
| import System.Exit (exitFailure) |
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
| #!/bin/sh | |
| echo "{" | |
| echo " \"checks\": {" | |
| for i in `ls /etc/sensu/plugins/*metrics.rb`; do | |
| [ -z $trc ] || echo $trc | |
| name=`basename $i | sed 's/\..*//'` | |
| echo " \"$name\": {" | |
| echo " \"type\": \"metric\"," |
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
| -- numbers | |
| zero _ = id | |
| one f = f | |
| two f = f . f | |
| -- numeric operators | |
| succ n f = f . (n f) | |
| plus m n f = (n f) . (m f) |
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
| From 635c5e90c99f631da2c7a2a3b885970114b429c4 Mon Sep 17 00:00:00 2001 | |
| From: horus <horus.li@gmail.com> | |
| Date: Fri, 26 Jul 2013 15:39:20 +0800 | |
| Subject: [PATCH] pass client address to mysql_get_resultset() | |
| --- | |
| contrib/dlz/drivers/dlz_mysql_driver.c | 41 +++++++++++++++++++++++++++++++--- | |
| 1 file changed, 38 insertions(+), 3 deletions(-) | |
| diff --git a/contrib/dlz/drivers/dlz_mysql_driver.c b/contrib/dlz/drivers/dlz_mysql_driver.c |
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 Data.Typeable | |
| import Data.Dynamic | |
| f :: Typeable a => Maybe a -> String | |
| f x | |
| | typeOf' x == "Maybe [Char]" = "string" | |
| | typeOf' x == "Maybe Int" = "int" | |
| | otherwise = "anything else" | |
| where typeOf' = flip (showsTypeRep . typeOf) "" |
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
| XCODE_ROOT=`xcode-select -print-path` | |
| SDK_ROOT=${XCODE_ROOT}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk | |
| FRAMEWORK_ROOT=${SDK_ROOT}/System/Library/Frameworks | |
| sed -i.bak -e 's|/Developer/Headers/FlatCarbon/Files.h|CarbonCore/Files.h|' fontforge/macbinary.c fontforge/startui.c gutils/giomime.c | |
| sed -i.bak -e 's|/Developer/Headers/FlatCarbon/CarbonEvents.h|HIToolbox/CarbonEvents.h|' fontforge/startui.c | |
| env CFLAGS="-isysroot ${SDK_ROOT} -F${FRAMEWORK_ROOT}/CoreServices.framework/Frameworks -F${FRAMEWORK_ROOT}/Carbon.framework/Frameworks" \ | |
| ./configure --prefix=$HOME/local --with-freetype-src=$HOME/local/src/freetype-2.5.0.1 \ | |
| --enable-double --without-freetype-bytecode --without-python --with-static-imagelibs |