class Functor f where
fmap :: (a -> b) -> f a -> f b
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
{-# LANGUAGE OverloadedStrings #-} | |
module Bitbucket ( | |
parseHook | |
) where | |
import Control.Applicative ((<$>)) | |
import Control.Lens | |
import Data.Aeson.Lens | |
import Data.List (nub) |
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
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
module Config ( | |
MyConfig, | |
RepositoryConfig, | |
BranchConfig, | |
HostConfig, | |
readConfig | |
) where |
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
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Monoid (mconcat) | |
import Network.Wai.Middleware.Static | |
import Web.Scotty | |
main = scotty 3000 $ do | |
middleware $ staticPolicy (noDots >-> addBase "static") | |
get "/" $ file "static/index.html" | |
get "/:word" $ do |
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
#!/bin/sh | |
apt-get install -y build-essential libgmp zlib1g | |
curl -sSL https://get.docker.com/ubuntu/ | sudo sh - |
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
import Base.ntoh | |
@vectorize_1arg Number Base.ntoh | |
function readIdx(file_name) | |
fs = open(file_name, "r") | |
magic_number = read(fs, UInt8, 4) | |
if magic_number[3] == 0x08 | |
idx_type = UInt8 | |
elseif magic_number[2] == 0x09 |
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
#!/bin/sh | |
PWD=$(pwd) | |
FORK_COMMIT="ca388dc0c6bac110254a4e5a175abbb7963b1f4f" | |
FORK_DATE="Wed Jul 15 22:04:42 2015 +100" | |
if [ ! -d "Unvanquished" ] | |
then | |
echo -e "Cloning full repository" | |
git clone https://github.com/Unvanquished/Unvanquished.git Unvanquished |
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'optparse' | |
require 'ostruct' | |
require 'pathname' | |
require 'pp' | |
$verbose = false |
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
Compiling playground v0.0.1 (file:///playground) | |
error[E0308]: mismatched types | |
--> src/main.rs:62:23 | |
| | |
62 | mem::swap(datum1.unwrap().1.borrow_mut(), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &mut _, found struct `std::cell::RefMut` | |
| | |
= note: expected type `&mut _` | |
found type `std::cell::RefMut<'_, std::sync::mpsc::Receiver<bool>>` | |
= help: try with `&mut datum1.unwrap().1.borrow_mut()` |
OlderNewer