Skip to content

Instantly share code, notes, and snippets.

View thiagocordeiro's full-sized avatar
🥵
Melting

Thiago Cordeiro thiagocordeiro

🥵
Melting
View GitHub Profile
@thiagocordeiro
thiagocordeiro / request.js
Last active August 20, 2019 07:25
Axios HTTP Client
const axios = require('axios');
axios.get('/users/12345')
.then(function (response) {
const statusCode = response.status;
// successful request/response
})
.catch(function (error) {
const statusCode = error.response.status;
# Added zsh shell.
sudo apt-get install zsh -y
wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
sudo chsh -s /bin/zsh vagrant && sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="af-magic"/g' ~/.zshrc && echo "alias ll=\"ls -lha\"" >> ~/.zshrc && zsh
# autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions && echo "source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.zshrc && source ~/.zshrc
# Added zsh shell.
sudo apt-get install zsh -y
wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
sudo chsh -s /bin/zsh vagrant && sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="af-magic"/g' ~/.zshrc && echo "alias ll=\"ls -lha\"" >> ~/.zshrc && zsh
# disable git when needed
git config --global oh-my-zsh.hide-status 1
# autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions && echo "source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.zshrc && source ~/.zshrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@thiagocordeiro
thiagocordeiro / Dart Class.dart
Last active April 28, 2021 00:14 — forked from buntagonalprism/Dart Class.dart
Flutter and Dart collection of file templates for Android Studio development
#set( $nameparts = $NAME.split("_"))
#set( $namepart = '')
#set( $classname = '')
#foreach( $namepart in $nameparts )
#set( $classname = $classname + $namepart.substring(0, 1).toUpperCase() + $namepart.substring(1))
#end
class $classname {
$classname();
}
<?php
/**
* @Route('/users', methods={'POST'})
*/
class RegisterUserController
{
private RegisterUserService $service;
public function __construct(RegisterUserService $service) { ... }
<?php
/**
* @Route('/users', methods={'POST'})
*/
class RegisterUserController
{
private RegisterUserService $service;
public function __construct(RegisterUserService $service)
<?php
class BaseController
{
public function __contruct(Foo $foo)
{
$this->foo = $foo;
}
}
<?php
class Email
{
private string $email;
public function __construct(string $email)
{
if (false === filter_var($email, FILTER_VALIDATE_EMAIL)) {
throw new Exception('Invalid Email');
@thiagocordeiro
thiagocordeiro / globo-pip.js
Last active July 27, 2021 12:50
Enable globo.com Picture in Picture
$('iframe').remove();
el=document.getElementById('c37');
el.removeEventListener('contextmenu', getEventListeners(el).contextmenu[0].listener);