Skip to content

Instantly share code, notes, and snippets.

View nickautomatic's full-sized avatar

Nick F nickautomatic

View GitHub Profile
@nickautomatic
nickautomatic / mintty.md
Last active September 8, 2016 17:01
Use mintty as the default console for Git on Windows
  • Add mintty.exe to Git\bin
  • Create shortcut in Git directory with the following target: "C:\Program Files\Git\bin\mintty.exe" --title "Git mintty" --icon "etc\git.ico" -c "%HOMEDRIVE%%HOMEPATH%\.minttyrc" --icon "etc\git.ico" --exec "bin\sh.exe" --login -i ('Starts in' should be set to "C:\Program Files\Git" in order for relative paths, eg. "etc\git.ico", to work)
  • In order to get colours working, add the following to .gitconfig:
    [color]
      status = always
      diff = always
    

log = always

@nickautomatic
nickautomatic / pretty git log
Created August 22, 2013 11:17
Pretty Git log
git log --graph --date-order --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(yellow) %an %Creset' --abbrev-commit --date=relative
@nickautomatic
nickautomatic / Useful Linux commands
Last active September 27, 2019 15:53
Useful Linux commands
ack --sass "([\d\.]*)r?em" --output="\$1" -h | sort -u
Find all unique em and rem values in all Sass files below the current directory
cat / less
Output contents of a text file. ("less" is paginated but disappears after end of file, "cat" outputs in one go but output remains visible in console).
chown user:group /something
Changes owner of /something to 'user', group to 'group'.
cp
@nickautomatic
nickautomatic / js style guide.md
Last active August 29, 2015 14:00
Javascript style guide
@nickautomatic
nickautomatic / Default (Windows).sublime-keymap
Last active March 14, 2018 17:10
Sublime Text keymap (with shortcuts from jEdit)
[
// My Sublime shortcuts:
{ "keys": ["ctrl+k", "ctrl+m"], "command": "toggle_minimap" },
// jEdit shortcuts:
{ "keys": ["alt+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["alt+right"], "command": "indent" },
{ "keys": ["alt+left"], "command": "unindent" },
{ "keys": ["ctrl+e", "ctrl+c"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+e", "ctrl+w"], "command": "close_all" },
## Global variables:
export PATH=/c/Program\ Files/cwRsync/:/c/Users/Nick/AppData/Roaming/npm/:$PATH
export VAGRANT_HOME=/c/HashiCorp/Vagrant/.vagrant.d/
## Custom Bash Prompt:
export PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '
## For nice diffs:
# install diff-so-fancy (npm -g diff-so-fancy)
# set pager to use it (git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX")
@nickautomatic
nickautomatic / Preferences.sublime-settings
Last active August 31, 2018 21:12
Sublime Text - User Settings
{
"bold_folder_labels": true,
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme",
"default_line_ending": "unix",
"enable_tab_scrolling": false,
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*~",
"*.exe",
@nickautomatic
nickautomatic / .visually-hidden
Last active February 28, 2018 06:21
Visually hidden / screen-reader only class
/* From Bootstrap 3 (I think...) */
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
border: 0;
@nickautomatic
nickautomatic / breakpoint.scss
Created March 10, 2015 16:19
Super-simple breakpoint mixin
// Super simple mobile-first breakpoint mixin:
@mixin breakpoint($from) {
@media screen and (min-width: $from) { @content; }
}
// Example usage:
$small: 480px;
nav {
@include breakpoint($small) {
display: none;
@nickautomatic
nickautomatic / Package Control.sublime-settings
Last active December 9, 2019 18:02
Sublime Text - Installed Packages
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"AdvancedNewFile",
"ApacheConf",
"Color Highlighter",