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
| function! SearchHoogle(q) | |
| call system('firefox "http://www.haskell.org/hoogle/?hoogle='.a:q.'" &') | |
| endfunction | |
| command! -nargs=1 Hoogle call SearchHoogle('<args>') | |
| if has("autocmd") | |
| au filetype haskell nmap K :call SearchHoogle(expand('<cword>'))<cr> | |
| endif |
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
| -- Given a File object, recursively discover all of its non-directory children | |
| listFiles :: (FileClass f) => f -> IO ([File]) | |
| listFiles f | |
| -- this file doesn't exist | |
| | fileQueryExists f Nothing == False = return ([]) | |
| -- this file isn't a directory | |
| | fileQueryFileType f [FileQueryInfoNone] Nothing /= FileTypeDirectory = return ([]) | |
| -- otherwise, create the enumerator and start looping |
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
| #include <allegro5/allegro.h> | |
| #include <glib.h> | |
| #include <stdio.h> | |
| int main(int argc, char *argv[]) | |
| { | |
| uint32_t al_version = al_get_allegro_version(); | |
| int al_major_version = al_version >> 24; | |
| int al_minor_version = (al_version >> 16) & 255; | |
| int al_revision = (al_version >> 8) & 255; |
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
| CC := clang | |
| TARGET := game | |
| AL_CFLAGS := -Ilib/allegro/include | |
| AL_LDFLAGS := -Llib/allegro/lib | |
| GLIB_CFLAGS := -Ilib/glib -Ilib/glib/glib | |
| GLIB_LDFLAGS := -Llib/glib/glib/.libs | |
| CFLAGS := -g -Wall $(AL_CFLAGS) $(GLIB_CFLAGS) | |
| LDFLAGS := $(AL_LDFLAGS) $(GLIB_LDFLAGS) |
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.Monad | |
| import qualified Data.IntMap as IM | |
| import qualified Data.List as L | |
| import Data.Maybe | |
| import Data.Text | |
| import qualified Data.Text.IO as TIO | |
| import Data.Text.Read | |
| import System.Exit | |
| main = forever $ do |
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.Monad | |
| import Data.List | |
| import Data.Maybe | |
| import System.Exit | |
| main = do | |
| -- get the number for this case, and exit if it's equal to 0 | |
| n <- liftM read getLine :: IO (Int) | |
| when (n == 0) exitSuccess | |
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
| CC := clang | |
| PKGS := libspotify alsa | |
| CFLAGS := -g -Wall `pkg-config --cflags $(PKGS)` | |
| LIBS := `pkg-config --libs $(PKGS)` -lpthread | |
| TARGET := spot | |
| SOURCES := $(shell find src/ -type f -name *.c) | |
| OBJECTS := $(patsubst src/%,build/%,$(SOURCES:.c=.o)) | |
| DEPS := $(OBJECTS:.o=.deps) |
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
| // src/main.c | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <libspotify/api.h> | |
| #define DEBUG 1 | |
| extern const uint8_t g_appkey[]; | |
| extern const size_t g_appkey_size; |
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
| CC := gcc | |
| CFLAGS := -g -Wall | |
| LIBS := -lallegro | |
| SOURCES := $(shell find src/ -type f -name "*.c") | |
| OBJECTS := $(SOURCES:.c=.o) | |
| TARGET := game | |
| all: $(SOURCES) $(TARGET) | |
| $(TARGET): $(OBJECTS) |
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.List | |
| type Input = [String] | |
| data Unsolved = Unsolved { unsolvedNumber :: Int, input :: Input } | |
| data Solved = Solved { solvedNumber :: Int, answer :: String } | |
| data Item = Item { index :: Int, price :: Int } | |
| instance Show Solved where |