This file contains 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 where | |
import Data.List | |
hexTo01s :: Char -> String | |
hexTo01s '0' = "0000" | |
hexTo01s '1' = "0001" | |
hexTo01s '2' = "0010" | |
hexTo01s '3' = "0011" | |
hexTo01s '4' = "0100" |
This file contains 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
# -*- coding: utf-8 -*- | |
import sublime | |
import sublime_plugin | |
import subprocess | |
class MilkGrepNewFileCommand(sublime_plugin.WindowCommand): | |
def panel_search_done(self, str): | |
pipe = subprocess.Popen('gmilk -a ' + str, shell=True, stdout=subprocess.PIPE).stdout | |
results = pipe.read() |
This file contains 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
########################### | |
# windows only | |
########################### | |
#import sublime | |
import sublime_plugin | |
import os | |
import os.path |
This file contains 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 where | |
import System | |
import Data.List | |
import Control.Monad | |
separateDiffPatch :: String -> [String] | |
separateDiffPatch str = map unlines . map (head . filter patchEnd . inits) . (filter patchStart . tails) . lines $ str | |
where | |
patchStart (l0 : l1 : l2 : ls) = and [isPrefixOf "From " l0, isPrefixOf "From: " l1, isPrefixOf "Date: " l2] |
This file contains 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
Set WSHShell = CreateObject("WScript.Shell") | |
WSHShell.Run "cmd.exe /c milk web", vbhide |
This file contains 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 where | |
import System.Directory | |
import Control.Monad | |
import Data.List | |
import Text.Regex | |
import Text.Regex.Posix | |
recursiveFiles :: FilePath -> IO [FilePath] |
This file contains 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 where | |
import System.Cmd | |
import Data.Graph.Inductive | |
import Data.Graph.Inductive.Graphviz | |
import Data.Graph.Inductive.Example | |
myGraph :: Gr String () | |
myGraph = mkGraph |
This file contains 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 | |
import System.Environment (getArgs) | |
import System.Console.GetOpt | |
data SearchOptions | |
= Query String | Rpp Int | Lang String | OutputFile String | |
deriving (Show) | |
options :: [OptDescr SearchOptions] |
This file contains 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
fromResult :: Result a -> Maybe a | |
fromResult (Ok k) = Just k | |
fromResult (Error e) = Nothing | |
maybeFromObj :: JSON a => String -> JSObject JSValue -> Maybe a | |
maybeFromObj k o = maybe (Nothing) (fromResult . readJSON) (lookup k (fromJSObject o)) |
NewerOlder