View piping.go
1 2 3 4 5 6 7 8 9 10
package main
 
import (
"bytes"
"exec"
"log"
"os"
)
 
// Pipeline strings together the given exec.Cmd commands in a similar fashion
View cmdlinefu.txt
1
find . -type f -size +1| xargs sed -ie '$s/$/\n/'
View output.txt
1 2 3 4 5 6 7 8 9 10
w size commit elapsed
1 1 1000 1.545
1 10 1000 0.307
1 50 1000 0.161
1 100 1000 0.131
1 500 1000 0.108
1 1000 1000 0.112
2 1 1000 1.231
2 10 1000 0.237
2 50 1000 0.121
View thoughts.md

Thoughts on JSON Patch

Introduction

JSON Patch is a media type developed to take advantage of the HTTP PATCH method. It includes operations such as add, remove, replace, copy, move, and test. Below is a first reaction to reading the specification. Note that the author has not attempted a real implementation of JSON Patch, which would certainly provide a more thorough analysis and different perspective.

Benefits

  1. The JSON Patch specification provides an actual media type to use with PATCH. This enables the PATCH method to be usable across client-server implementations. It's a real attempt at solving the partial update problem in Web APIs.
  2. JSON Patch documents allow shallow and nested object updates.
View bash_prompt.sh
1 2 3 4 5 6 7 8 9
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from https://github.com/gf3/dotfiles
# Screenshot: http://i.imgur.com/s0Blh.png
 
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
View fieldclf.go
1 2 3 4 5
package main
 
func main() {
fmt.Println("fieldclf, a MARC field classifier.")
}
View gist:4fcb956227b40d11877a
1 2 3 4 5 6 7 8 9 10
1986
2004
19XX|anfangs
19XX
19XX
2005-2009|bis Bd. 21
1985-1993
1988-1991
anfangs|1953-1959|1960-1994
19XX
View main.rs
1 2 3 4 5 6 7 8 9 10
// This code is editable and runnable!
fn main() {
// A simple integer calculator:
// `+` or `-` means add or subtract by 1
// `*` or `/` means multiply or divide by 2
 
let program = "+ + * - /";
let mut accumulator = 0i;
 
for token in program.chars() {
View ghd.md

Show all files touched by a user:

$ git log --no-merges --stat --author="pattern" --name-only --pretty=format:"" | sort -u

Show all files with their status modified, added or deleted by user:

$ git log --no-merges --stat --author="pattern" --name-status --pretty=format:""|grep -v '^$'
View sft.md

Simple File Transformations

A simple file transformation describes the transformation of a file from one shape into another. Transformations are

  • expressed in JavaScript and
  • applied on each line of the input file.

The transformation script can use two global variables: in and out.

Something went wrong with that request. Please try again.