Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
sudo fsck_exfat -d disk0sXXX | |
diskutil repairvolume /Volumes/XXX/ |
{-# LANGUAGE MagicHash, TupleSections, TemplateHaskell #-} | |
module Data.Vector.Storable.Bake(bake, unsafeFromAddrLen) where | |
import Data.Typeable | |
import qualified Data.Vector.Storable as VS | |
import Foreign | |
import GHC.Prim | |
import GHC.Ptr | |
import Language.Haskell.TH |
/** | |
* Let's say I can read things from a "Store" | |
*/ | |
trait Store[F] { | |
def read(path: Path): F[String] | |
} | |
/** | |
* Now I want to read more specific things, like a Configuration | |
* |
find . -type f -name "* conflicted copy*" -exec rm -f {} \; | |
awk '!/conflicted/' .git/packed-refs > temp && mv temp .git/packed-refs |
#!/bin/bash | |
# References | |
# http://www.computerhope.com/unix/nc.htm#03 | |
# https://github.com/daniloegea/netcat | |
# http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze | |
# http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982 | |
# http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip | |
# http://www.dest-unreach.org/socat/ | |
# http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#add script to .oh-my-zsh/lib/functions.zsh | |
function rm () { | |
local path | |
for path in "$@"; do | |
# ignore any arguments | |
if [[ "$path" = -* ]]; then : | |
else | |
local dst=${path##*/} | |
# append the time if necessary |
This post aims to document a practical design implementation we came up with when designing some APIs in Scala. Of course the concept is not Scala specific and applies to other functional languages.
If you don't want to go into the full introduction, this post talks about how Applicatives are too restrictive and breaking them into two independent components can be interesting for Contravariant and Invariant Functors. Jump to implementation attached.
We are taking JSON serialization/deserialization as a motivating example.
JsValue
is the name of the type that represents the JSON AST. What we need is to be able to read a JsValue
and produce an A
:
trait Reads[A]{
--- | |
#### | |
#### THIS IS OLD AND OUTDATED | |
#### LIKE, ANSIBLE 1.0 OLD. | |
#### | |
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES | |
#### | |
#### IF IT BREAKS I'M JUST SOME GUY WITH | |
#### A DOG, OK, SORRY | |
#### |
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |