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
#!/usr/bin/env zsh | |
color_red=$(tput setaf 1) | |
color_green=$(tput setaf 2) | |
color_reset=$(tput sgr0) | |
#--------------------------------------------------------------------------------------------------------------- | |
# Docker | |
#--------------------------------------------------------------------------------------------------------------- | |
alias dc='docker compose' |
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
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz | |
tar -xzf libtool-2.4.2.tar.gz | |
cd libtool-2.4.2 | |
./configure && make && sudo make install | |
# brew install 'https://raw.github.com/simonair/homebrew-dupes/e5177ef4fc82ae5246842e5a544124722c9e975b/ab.rb' | |
# brew test ab | |
curl -O https://archive.apache.org/dist/httpd/httpd-2.4.2.tar.bz2 | |
tar zxvf httpd-2.4.2.tar.bz2 |
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
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | |
" " | |
" .::::. " | |
" ___________ :;;;;:`____________ " | |
" \_________/ ?????L \__________/ " | |
" |.....| ????????> :.......' " | |
" |:::::| $$$$$$"`.:::::::' , " | |
" ,|:::::| $$$$"`.:::::::' .OOS. " | |
" ,7D|;;;;;| $$"`.;;;;;;;' .OOO888S. " | |
" .GDDD|;;;;;| ?`.;;;;;;;' .OO8DDDDDNNS. " |
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
""" | |
Flask simple API | |
------------------------------------------------- | |
1) Install dependencies with `pip install flask gunicorn` | |
2) Run with `gunicorn -b 0.0.0.0:5555 app:app --reload --capture-output` | |
""" | |
from flask import Flask, request, jsonify, abort |
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
def ntimes(n): | |
def inner(f): | |
def wrapper(*args, **kwargs): | |
for _ in range(n): | |
print('Running: {.__name__}'.format(f)) | |
rv = f(*args, **kwargs) | |
return rv | |
return wrapper | |
return inner |
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
<?php | |
$config = PhpCsFixer\Config::create() | |
->setRules([ | |
'@PSR2' => true, | |
'array_syntax' => ['syntax' => 'short'], | |
'no_unused_imports' => true, | |
'ordered_imports' => true, | |
'no_whitespace_in_blank_line' => true, | |
'blank_line_before_statement' => 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
- Open Automator | |
- File -> New -> Service | |
- Change "Service Receives" to "files or folders" in "Finder" | |
- Add a "Run Shell Script" action | |
- Change "Pass input" to "as arguments" | |
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*" | |
- Save it as something like "Open in Visual Studio Code" |
Table of Contents
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 | |
# usage: split.sh foo,bar | |
options=($(echo $1 | tr "," "\n")) | |
for i in "${options[@]}" | |
do | |
case $i in | |
"foo") |
OlderNewer