Skip to content

Instantly share code, notes, and snippets.

View GabrielCzar's full-sized avatar
🥋

Gabriel César GabrielCzar

🥋
View GitHub Profile
@GabrielCzar
GabrielCzar / git-update-fork.sh
Last active December 16, 2022 15:48 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario_projeto_original/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
# vim:ft=zsh ts=2 sw=2 sts=2
rvm_current() {
rvm current 2>/dev/null
}
rbenv_version() {
rbenv version 2>/dev/null | awk '{print $1}'
}
#List all devices
dmesg
# ou
sudo fdisk -l
#OS is the name do Operation System
#sd* is the final device - Usb or other
sudo dd if=SO.iso of=/dev/sd* bs=4M status=progress
@GabrielCzar
GabrielCzar / git_config.sh
Last active April 28, 2021 15:16
Git Config SSH Keygen
#!/bin/bash
# Crie a chave SSH na sua maquina
# Apenas confirme todas as entradas, mas se quiser mais seguranca coloque uma senha na hora que for solicitado
# No caso do SO Windows usa o ssh-keygen.exe
ssh-keygen -C "[email protected]"
# Logue na conta do github
# Entre no seguinte link
# https://github.com/settings/keys
# Install
sudo apt-get install --no-install-recommends gnome-panel
# Create icon
gnome-desktop-item-edit --create-new .local/share/applications
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=command to run here
Name=visible name here
Comment=comment here
Icon=icon path here
@GabrielCzar
GabrielCzar / rest-controller.java
Last active July 19, 2017 01:24
Rest Controller Basic Implementation
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
-- O repositorio do postgres ja vem no deepin
sudo apt install postgresql-9.6
-- Entre no PSQL
sudo -u postgres psql
-- Mude a senha do postgres
ALTER USER postgres WITH ENCRYPTED PASSWORD 'nova_senha';
-- Acesse a pasta do postgres
[
{
'isbn': 441,
'titulo': 'Programação Orientada a Objetos',
'ano_publicacao': 2012,
'qtd_estoque': 1,
'valor': 70.00,
'editora': 'Ática'
},
{
curl -X POST https://overpass-api.de/api/interpreter -H "Content-Type: application/x-www-form-urlencoded" -d "data=[out:json];node ++[amenity] ++(39.83385008019448,114.3896484375,40.6723059714534,118.5369873046875); out;"