Skip to content

Instantly share code, notes, and snippets.

View wuiler's full-sized avatar
Working from home

Jose Wuiler Pozzi wuiler

Working from home
View GitHub Profile
@wuiler
wuiler / postgres-cheatsheet.md
Created November 25, 2020 20:15 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@wuiler
wuiler / ImageExample.java
Created November 13, 2020 21:17
JavaFX Image Sample
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;
public class ImageExample extends Application {
@Override
public void start(Stage stage) throws java.io.FileNotFoundException {
{
"meta": { "theme": "elegant" },
"basics": {
"name": "Jose Wuiler Pozzi",
"label": "Developer aHR0cHM6Ly93d3cuamF2YS5uZXQuYXIvbWU=",
"image": "https://www.gravatar.com/avatar/5e616573ae1838d19d198bba3eeb4b34",
"summary": "I consider myself a Software Craftsman who model apps, JAVA enthusiasts and with an open mind to learn everything. OpenSource collaborator",
"url": "https://www.java.net.ar/",
"email": "wuiler@gmail.com",
"location": {
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.codec.digest.HmacUtils;
private Boolean isTelegramAccountDataRight(
String telegramAccountData, // data check string
String telegramBotToken // bot token
) {
byte[] data = telegramAccountData.toString().getBytes();
byte[] secret = DigestUtils.sha256(telegramBotToken);
@wuiler
wuiler / paginate.php
Created January 16, 2018 19:17 — forked from vluzrmos/paginate.php
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator