Skip to content

Instantly share code, notes, and snippets.

View petronetto's full-sized avatar
🤖
What's up human?

Juliano Petronetto petronetto

🤖
What's up human?
View GitHub Profile
@petronetto
petronetto / Mac OS X: Open in Visual Studio Code
Created May 9, 2018 23:39 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- 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"
@petronetto
petronetto / .php_cs
Created March 31, 2018 04:56
PHPCS Fixer configs
<?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,
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
@petronetto
petronetto / app.py
Created November 28, 2017 16:52
Simple Flask RESTful API
"""
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
@petronetto
petronetto / .vimrc
Last active May 29, 2019 09:30
My Vim Config
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
" "
" .::::. "
" ___________ :;;;;:`____________ "
" \_________/ ?????L \__________/ "
" |.....| ????????> :.......' "
" |:::::| $$$$$$"`.:::::::' , "
" ,|:::::| $$$$"`.:::::::' .OOS. "
" ,7D|;;;;;| $$"`.;;;;;;;' .OOO888S. "
" .GDDD|;;;;;| ?`.;;;;;;;' .OO8DDDDDNNS. "
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
@petronetto
petronetto / iterm2-solarized.md
Created April 16, 2017 05:32 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@petronetto
petronetto / .zsh_aliases
Last active September 7, 2023 10:38
ZSH Config
#!/usr/bin/env zsh
color_red=$(tput setaf 1)
color_green=$(tput setaf 2)
color_reset=$(tput sgr0)
#---------------------------------------------------------------------------------------------------------------
# Docker
#---------------------------------------------------------------------------------------------------------------
alias dc='docker compose'