Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)
--[[ | |
TIC-TAC-TOE | |
by Evan Hahn (http://www.evanhahn.com/) | |
This is a program that allows you to play tic-tac-toe against the | |
computer. | |
You may change the configuration (below) to make the board more than 3x3, | |
or play with "white" and "black" instead of "x" and "o", and change how |
{-# LANGUAGE TemplateHaskell, FlexibleInstances #-} | |
module CustomShow where | |
import Language.Haskell.TH | |
import Data.List (intercalate) | |
emptyShow :: Name -> Q [Dec] | |
emptyShow name = [d|instance Show $(conT name) where show _ = ""|] |
function mycd() | |
{ | |
#if this directory is writable then write to directory-based history file | |
#otherwise write history in the usual home-based history file | |
tmpDir=$PWD | |
echo "#"`date '+%s'` >> $HISTFILE | |
echo $USER' has exited '$PWD' for '$@ >> $HISTFILE | |
builtin cd "$@" # do actual cd | |
if [ -w $PWD ]; then export HISTFILE="$PWD/.dir_bash_history"; touch $HISTFILE; chmod --silent 777 $HISTFILE; | |
else export HISTFILE="$HOME/.bash_history"; |
Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)
#!/usr/bin/env node | |
var ticks = '▁▂▃▄▅▆▇'.split(''), | |
values = process.argv.slice(2); | |
var min = Math.min.apply(0, values), | |
range = Math.max.apply(0, values) - min, | |
scale = ticks.length - 1; | |
console.log( values.map(function(x){ |
# | |
# Enable CEPH repos as described at http://ceph.com/docs/master/install/get-packages/#rpm | |
# Install ceph-deploy package | |
# | |
export DATA_DEV=sdb | |
export JRNL_DEV=sdc | |
export FS_TYPE=xfs | |
export CEPH_S_NODE=ceph-s | |
export CEPH_RELEASE=giant |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{- | |
Explores Free Monads (DSLs) and Cofree Comonads (interpreters) and | |
their relationship. | |
Most of the code in this file comes from (1) below. Only minor | |
modifications are made - semantics are preserved. |
Title | Author(s) | Year |
---|---|---|
Intuitionistic Type Theory | Per Martin-Löf | 1984 |
On the Meanings of the Logical Constants and the Justification of the Logical Laws | Per Martin-Löf | 1996 |
[[http://mat.uab.cat/~kock/crm/h |
Google's GBoard software keyboard has a Morse code mode.
Here's what characters it currently supports:
.-
→ a
-...
→ b
-.-.
→ c
-..
→ d