This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Example: in $dir git status | |
(source ~/.zshrc; cd $1; ${@:2}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ( | |
DatabaseConfigFile = "database.json" | |
DatabaseDriver = "mysql" | |
DatabaseKey = "db" | |
) | |
type DatabaseConfig struct { | |
Driver struct { | |
Database string `json:"dbname"` | |
Host string `json:"host"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"encoding/json" | |
) | |
// Given an input slice of bytes representing an arbitrary JSON object and a slice of strings containing keys | |
// which should not exist in the input JSON object, remove these keys from original object. | |
func removeKeysFromJSONObject(input *map[string]json.RawMessage, keys []string) { | |
for _, key := range keys { | |
delete(*input, key) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import islice, zip_longest | |
def yield_subgroups(group, subgroup_test): | |
subgroup = [] | |
for i, j in zip_longest(group, islice(group, 1, None)): | |
if subgroup_test(i, j): | |
yield subgroup | |
subgroup = [] | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func! DeleteTrailingWS() | |
exe "normal mz" | |
%s/\s\+$//ge | |
exe "normal `z" | |
endfunc | |
for suffix in ["py", "js", "css", "cpp", "c", "h", "hpp", "rs", "groovy", "groovy.j2"] | |
execute 'autocmd BufWrite *.'.suffix.' :call DeleteTrailingWS()' | |
endfor | |
for prefix in ["Jenkinsfile"] | |
execute 'autocmd BufWrite '.prefix.'* :call DeleteTrailingWS()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000556284/comments/360000146344 | |
Specify the absolute path to `node_modules/@vue/cli-service/webpack.config.js` as a webpack config under `Languages & Frameworks / Javascript / Webpack`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SPECTACLE_VERSION="1.2" | |
RDM_VERSION="2.2" | |
install_brew=false | |
install_utils=true | |
install_dev_tools=true | |
install_webdev_tools=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim-grep, open all files containing grepped string | |
function vim-grep { | |
GREP_OPTIONS="-rnw $1 -e $2" | |
for var in "${@:3}"; | |
do | |
GREP_OPTIONS+=" --include \"$var\"" | |
done | |
vim $(eval "grep $GREP_OPTIONS" | cut -f1 -d: | uniq | tr "\n" " ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind J resize-pane -D 5 | |
bind K resize-pane -U 5 | |
bind H resize-pane -L 5 | |
bind L resize-pane -R 5 | |
bind M-j resize-pane -D | |
bind M-k resize-pane -U | |
bind M-h resize-pane -L | |
bind M-l resize-pane -R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: | |
"/etc/httpd/conf.d/ssl_rewrite.conf": | |
mode: "000644" | |
owner: root | |
group: root | |
content: | | |
RewriteEngine On | |
<If "-n '%{HTTP:X-Forwarded-Proto}' && %{HTTP:X-Forwarded-Proto} != 'https'"> | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] | |
</If> |
NewerOlder