Skip to content

Instantly share code, notes, and snippets.

@andrewmilson
andrewmilson / file-upload-multipart.go
Last active June 28, 2025 18:41
Golang multipart/form-data File Upload
package main
import (
"net/http"
"os"
"bytes"
"path"
"path/filepath"
"mime/multipart"
"io"
@k-takata
k-takata / bash-completion-slowness-on-msys2.md
Created May 13, 2015 15:08
Bash-completion is very slow on MSYS2

Bash-completion is very slow on MSYS2

Bash-completion is very slow on MSYS2 when the current user is a domain user. This describes the cause and the solutions.

Cause

Expansion of ~* is very slow when you use a domain user. For example:

@deanrather
deanrather / Bash Comparison Operators.md
Last active March 20, 2023 02:21
Bash Comparison Operators

Bash Comparison Operators

Integer Comparison

Operator   Description                      Example
-eq        Is Equal To                      [ 100 -eq 100 ]
-ne        Is Not Equal To                  [ 100 -ne 200 ]
-gt        Is Greater Than                  [ 200 -gt 100 ]
-ge        Is Greater Than Or Equal To      [ 100 -ge 100 ]
-lt        Is Less Than                     [ 100 -lt 200 ]

-le Is Less Than Or Equal To [ 100 -le 100 ]

@JunichiIto
JunichiIto / alias_matchers.md
Last active July 3, 2025 16:09
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@hfs
hfs / .gitignore
Last active May 24, 2024 07:06 — forked from sit/.gitignore
How to keep Jenkins configurations in a git repository. Put .gitignore in Jenkins’ home directory (/var/lib/jenkins). Initialize a git repository and add a remote to push to. Create a new Jenkins job to run e.g. nightly with the content of backup.sh as shell execution build step.
# Non-config file types
*.log
*.log.*
*.tmp
*.old
*.bak
*.jar
*.jpi
*.jpi.pinned
*.json
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 13, 2025 11:58
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@katylava
katylava / git-selective-merge.md
Last active February 27, 2024 10:18
git selective merge

Update 2022: git checkout -p <other-branch> is basically a shortcut for all this.

FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.