Skip to content

Instantly share code, notes, and snippets.

@kei-q
kei-q / policy.json
Created September 1, 2015 08:58
cloudFormationで新しいresource追加したいけどうっかり既存のresourcesが更新されたら困る!!!!ときのpolicy
{
"Statement" : [
{
"Effect" : "Allow",
"Principal" : "*",
"Action" : "Update:*",
"Resource" : "*"
},
{
"Effect": "Deny",
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Main where
import Text.Trifecta hiding (between)
import Text.Parser.Token.Style
import Control.Applicative
import Data.Char (isSpace)
import qualified Data.Aeson as Aeson
import Data.Aeson ((.=))
import Data.Vector (fromList)
@kei-q
kei-q / Parse.podspec.json
Last active August 29, 2015 14:08
parse-1.4.2
{
"name": "Parse",
"version": "1.4.2",
"license": {
"type": "Commercial",
"text": "See https://www.parse.com/about/terms"
},
"homepage": "https://www.parse.com/",
"summary": "Parse is a complete technology stack to power your app's backend.",
getDirectoryContentsRecursively' :: FilePath -> IO [FilePath]
getDirectoryContentsRecursively' path = do
isDir <- doesDirectoryExist path
if isDir
then do
dirs <- filter (`notElem` [".",".."]) <$> getDirectoryContents path
concat <$> forM dirs (getDirectoryContentsRecursively' . (path </>))
else return [path]
@kei-q
kei-q / Gemfile
Last active August 29, 2015 14:03
source 'https://rubygems.org'
ruby '2.1.2'
gem 'sinatra', '~>1.4.4'
gem 'thin'
gem 'coderay'
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import Data.Conduit (($$), ($=), (=$=))
# update
# upgrade
# brew
# -----------------------------------------------------------------------------
# 定番どころ
install ack
install the_silver_searcher
ICONS = {"adjust"=>"f042", "adn"=>"f170", "align-center"=>"f037", "align-justify"=>"f039", "align-left"=>"f036", "align-right"=>"f038", "ambulance"=>"f0f9", "anchor"=>"f13d", "android"=>"f17b", "angle-double-down"=>"f103", "angle-double-left"=>"f100", "angle-double-right"=>"f101", "angle-double-up"=>"f102", "angle-down"=>"f107", "angle-left"=>"f104", "angle-right"=>"f105", "angle-up"=>"f106", "apple"=>"f179", "archive"=>"f187", "arrow-circle-down"=>"f0ab", "arrow-circle-left"=>"f0a8", "arrow-circle-o-down"=>"f01a", "arrow-circle-o-left"=>"f190", "arrow-circle-o-right"=>"f18e", "arrow-circle-o-up"=>"f01b", "arrow-circle-right"=>"f0a9", "arrow-circle-up"=>"f0aa", "arrow-down"=>"f063", "arrow-left"=>"f060", "arrow-right"=>"f061", "arrow-up"=>"f062", "arrows"=>"f047", "arrows-alt"=>"f0b2", "arrows-h"=>"f07e", "arrows-v"=>"f07d", "asterisk"=>"f069", "backward"=>"f04a", "ban"=>"f05e", "bar-chart-o"=>"f080", "barcode"=>"f02a", "bars"=>"f0c9", "beer"=>"f0fc", "bell"=>"f0f3", "bell-o"=>"f0a2", "bitbucket"=>"f171", "bi
@kei-q
kei-q / fay.hs
Created January 27, 2014 14:30
SICPのコード(pre)に色を付ける
module Hello where
import FFI
data Element
preAll :: Fay [Element]
preAll = ffi "document.querySelectorAll('pre')"
setColor :: String -> Element -> Fay ()
Build ./build/iPhoneSimulator-7.0-Development
Create ./build/iPhoneSimulator-7.0-Development/Tweets.app/Info.plist
Simulate ./build/iPhoneSimulator-7.0-Development/Tweets.app
(main)> 2013-12-05 00:47:53.370 Tweets[34928:1003] data_parser.rb:6:in `parse:': exception class/object expected (TypeError)
from json_parser.rb:3:in `parse_from_url:'
from tweets_controller.rb:23:in `block in searchBarSearchButtonClicked:'
2013-12-05 00:47:53.372 Tweets[34928:1003] *** Terminating app due to uncaught exception 'TypeError', reason: 'data_parser.rb:6:in `parse:': exception class/object expected (TypeError)
from json_parser.rb:3:in `parse_from_url:'
from tweets_controller.rb:23:in `block in searchBarSearchButtonClicked:'
'