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 python | |
import re | |
import sys | |
def remove_double_space_dots(s): | |
while " " in s: | |
s = s.replace(" ", " ") | |
while ".." in s: | |
s = s.replace("..", ".") |
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 FlexibleInstances, UndecidableInstances, MultiParamTypeClasses #-} | |
import Control.Monad.Writer | |
newtype CoroutineT m a = CoroutineT { runCoroutineT :: m (Either (CoroutineT m a) a) } | |
instance Monad m => Functor (CoroutineT m) where | |
fmap = liftM | |
instance Monad m => Applicative (CoroutineT m) 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
{ | |
"created_at": "Wed Oct 21 19:24:31 +0000 2015", | |
"id": 656913977029632000, | |
"id_str": "656913977029632000", | |
"text": "@__jud4s\r> stateless\r> hello world\rSounds like a typical immigrant experience.", | |
"source": "<a href=\"http://www.twitter.com\" rel=\"nofollow\">Twitter for Windows Phone</a>", | |
"truncated": false, | |
"in_reply_to_status_id": 656901694811320300, | |
"in_reply_to_status_id_str": "656901694811320320", | |
"in_reply_to_user_id": 226688217, |
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
_pants_goal_completion() { | |
# invoke pants to list goals | |
local pants_command=${COMP_WORDS[0]} | |
local goals_array=$(PANTS_NO_TRANSLATION=1 $pants_command -q goals | grep -v "Installed goals" | cut -d ":" -f 1 | sed -e 's/^[[:space:]]*//') | |
# ...or use a precomputed list | |
#local goals_array="autoblame bash-completion binary bootstrap builddict buildprops bundle changed check_published_deps clean-all clean-all-async compile compile-changed compute-buildprops deferred-sources dependees dependees_owners dependencies depmap detect-duplicates doc eclipse ensime export filedeps filemap filter gen goals idea invalidate jar killserver list markdown minimize ng-killall path pathdeps paths publish repl repl-dirty resolve roots run run-dirty server setup-py sort targets test test-changed thrift-linter unpack-jars" | |
local prefix=${COMP_WORDS[COMP_CWORD]} | |
if [[ $prefix == *"/"* ]]; then |
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/bash | |
g++ -O2 -Wall quine.cpp -o quine && ./quine > result.cpp && diff quine.cpp result.cpp |