This is a vimdiff cheat sheet as a git mergetool.
]c - go to next difference
<?php | |
function curl_setopt_custom_postfields($ch, $postfields, $headers = null) { | |
$algos = hash_algos(); | |
$hashAlgo = null; | |
foreach ( array('sha1', 'md5') as $preferred ) { | |
if ( in_array($preferred, $algos) ) { | |
$hashAlgo = $preferred; | |
break; | |
} | |
} |
## | |
# Apache .htaccess template | |
## | |
## Protect files and directories from prying eyes. | |
<FilesMatch "\.(make|test|md|po|sh|.*sql|.*bson|tpl(\.php)?|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$"> | |
Order allow,deny | |
</FilesMatch> | |
## Don't show directory listings for URLs which map to a directory. |
========================================== ========================================== | |
TMUX COMMAND WINDOW (TAB) | |
========================================== ========================================== | |
List tmux ls List ^b w | |
New new -s <session> Create ^b c | |
Attach att -t <session> Rename ^b , <name> | |
Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
Kill kill-session -t <session> Close ^b & |
[ | |
{ "keys": ["ctrl+super+a"], "command": "alignment" }, | |
{ "keys": ["ctrl+super+f"], "command": "reindent", "args": {"single_line": false}}, | |
{ "keys": ["super+v"], "command": "paste_and_indent" }, | |
{ "keys": ["super+shift+v"], "command": "paste" }, | |
{ "keys": ["super+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} }, | |
] |
#!/usr/bin/env ruby | |
# Colorize string | |
class String | |
def colorize(color_code) | |
"\e[#{color_code}m#{self}\e[0m" | |
end | |
end | |
class Colors |
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all. | |
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one. | |
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format | |
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files. | |
$ cd /tmp/ | |
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist . | |
$ plutil -convert xml1 com.googlecode.iterm2.plist | |
$ vi com.googlecode.iterm2.plist |
By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk.
This process is outlined at the Nginx ngx_http_fastcgi_module page manual page.
function getBackgroundColor(rangeSpecification) { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet(); | |
return sheet.getRange(rangeSpecification).getBackground(); | |
} | |
function getForegroundColor(rangeSpecification) { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet(); | |
return sheet.getRange(rangeSpecification).getFontColor(); | |
} |
(a moderately, well, shameless rework of Holden Karau's "Scala - Crash Course")
Scala is a multi-paradigm high-level language for the JVM.
It offers the ability to use both Object-oriented & Functional approaches.
Scala is statically typed. Type inference eliminates the need for more explicit type declarations.