Skip to content

Instantly share code, notes, and snippets.

@escribano
escribano / osx-brew-gnu-coreutils-man.sh
Created September 30, 2021 18:55 — forked from quickshiftin/osx-brew-gnu-coreutils-man.sh
Running GNU coreutils via Homebrew on your Mac? Here's a one-liner to get the manpages working!
# Short of learning how to actually configure OSX, here's a hacky way to use
# GNU manpages for programs that are GNU ones, and fallback to OSX manpages otherwise
alias man='_() { echo $1; man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1 1>/dev/null 2>&1; if [ "$?" -eq 0 ]; then man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1; else man $1; fi }; _'
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@escribano
escribano / README.md
Created September 14, 2021 01:57 — forked from dragon788/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@escribano
escribano / README.md
Created September 14, 2021 01:51 — forked from atenni/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

digraph sameaddress {
///////////////////////////////////////
// Global setup
///////////////////////////////////////
node [shape=record];
rankdir=LR;
//ranksep=1;
nodesep=0.5;
@escribano
escribano / mac.md
Created April 20, 2021 22:44 — forked from lornajane/mac.md
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
<VirtualHost *:80>
DocumentRoot "/Users/rwaterbury/Development/sandbox/famous/slideshow"
ServerName famous.slideshow.local
ErrorLog "/Users/rwaterbury/Development/sandbox/famous/slideshow.local-error_log"
CustomLog "/Users/rwaterbury/Development/sandbox/famous/slideshow.local-access_log" common
<Directory "/Users/rwaterbury/Development/sandbox/famous/slideshow">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
@escribano
escribano / spawn-fcgi.sh
Created December 6, 2016 04:33 — forked from ozeias/spawn-fcgi.sh
starts FastCGI for PHP using start-stop-daemon
## railsbox.org:~ ozeias$ vim /etc/init.d/spawn-fcgi
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts FastCGI for PHP
@escribano
escribano / GitHub protocol comparison.md
Created October 30, 2016 22:31
A comparison of protocols offered by GitHub (for #git on Freenode).

Primary differences between SSH and HTTPS. This post is specifically about accessing Git repositories on GitHub.

Protocols to choose from when cloning:

plain Git, aka git://github.com/

  • Does not add security beyond what Git itself provides. The server is not verified.

    If you clone a repository over git://, you should check if the latest commit's hash is correct.

@escribano
escribano / golang.md
Created September 28, 2016 07:25
Golang

Catコマンド -nオプションつけると、ラインナンバーつけられる

// ./play -n play.go
package main
import (
  "bufio"
  "flag"
  "os"
  "fmt"