Skip to content

Instantly share code, notes, and snippets.

View LeoFalco's full-sized avatar
🎯
Focusing

Leonardo Falco LeoFalco

🎯
Focusing
View GitHub Profile
import br.com.crush.BoyFriend;
import br.com.crush.GirlFirend;
public class TrueLove {
public static void main(String args...){
private final GirlFriend thallia = new GirlFirend("Thallia");
private BoyFriend me = new BoyFriend("leo");
@LeoFalco
LeoFalco / dump-mysql-database.cmd
Last active October 18, 2018 17:57
utilitario para backup do mysql via linha de comando
:: tanks for https://erisilva.net/backup-automatico-do-mysql/
set user="root"
set password="teste"
set backupDir="C:\bkpmysql"
set databases="financeiro218"
set host="localhost"
@echo off
:: get date
@LeoFalco
LeoFalco / scratch.sql
Created September 25, 2018 17:52
enable mysql log into file
SET global general_log = 0;
SET global log_output = 'file';
set global general_log_file='C:/bkpmysql/log.txt';
@LeoFalco
LeoFalco / Funcoes.java
Created October 16, 2018 21:52
consultar serial HD
public String consultarSerialHD(String drive) {
StringBuilder result = new StringBuilder();
try {
File file = File.createTempFile("tmp", ".vbs");
file.deleteOnExit();
FileWriter fw = new FileWriter(file);
String vbs = "Set objFSO = CreateObject(\"Scripting.FileSystemObject\")\n" + "Set colDrives = objFSO.Drives\n"
+ "Set objDrive = colDrives.item(\"" + drive + "\")\n" + "Wscript.Echo objDrive.SerialNumber";
fw.write(vbs);
fw.close();
@LeoFalco
LeoFalco / delete-nota.sql
Created October 18, 2018 16:52
deleta notas
update consumo set id_consumo_juncao = null
where id_consumo_juncao is not null;
delete from consumo_item;
update nota_item SET ID_ITEM_PAI = null
where ID_ITEM_PAI is not null;
delete from nota_item;
@LeoFalco
LeoFalco / ResponseTimeLogger.java
Created January 9, 2020 14:10 — forked from erard22/ResponseTimeLogger.java
An interceptor logging the response time and additional information of a REST call to a Resteasy resource
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.ext.Provider;
import org.jboss.resteasy.annotations.interception.ServerInterceptor;
import org.jboss.resteasy.core.ResourceMethod;
import org.jboss.resteasy.core.ServerResponse;
import org.jboss.resteasy.spi.Failure;
import org.jboss.resteasy.spi.HttpRequest;
@LeoFalco
LeoFalco / app.js
Created March 9, 2020 14:13 — forked from gupta-pratik/app.js
AngularJs Authorization and permissions on routes and views.
'use strict';
// Declare app level module which depends on views, and components
var app = angular.module('eopd', [
'ngRoute',
'app.directives'
'app.services'
])
.config([
'$locationProvider', '$routeProvider', '$httpProvider', 'ScrollBarsProvider', function ($locationProvider, $routeProvider, $httpProvider, ScrollBarsProvider) {
@LeoFalco
LeoFalco / .zshrc
Last active May 4, 2020 15:52 — forked from diego3g/.zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export ANDROID_HOME=~/Android/Sdk
export PATH="$PATH:$ANDROID_HOME/tools"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
# Path to your oh-my-zsh installation.
export ZSH="~/.oh-my-zsh"
export PATH="$PATH:/usr/local/bin"
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"