Skip to content

Instantly share code, notes, and snippets.

View webjoaoneto's full-sized avatar

João Neto webjoaoneto

View GitHub Profile
@webjoaoneto
webjoaoneto / poppler.sh
Created September 13, 2023 17:16
poppler commands
#!/bin/sh
apt update
apt-get update
apt-get install -y locate \
libopenjp2-7 \
poppler-utils
rm -rf /poppler_binaries; mkdir /poppler_binaries;
updatedb
cp $(locate libpoppler.so) /poppler_binaries/.
@webjoaoneto
webjoaoneto / reset-usb-devices.sh
Created March 5, 2021 15:40
Mouse no Ubuntu 20.04 travando? Coloque esse script no seu PATH e volte a vida
#!/bin/bash
#
# From: https://unix.stackexchange.com/a/611305
#
#
#
#
# This script resets all USB devices then reconnect
#
@webjoaoneto
webjoaoneto / App.tsx
Created February 11, 2020 01:44
Firebase Auth Token Refresh
import React, { useState, useEffect } from 'react';
import { Button, Text, StyleSheet, View } from 'react-native';
import auth from '@react-native-firebase/auth';
async function register(email: string, password: string) {
const credentials = auth.EmailAuthProvider.credential(email, password);
try {
await auth().signInWithCredential(credentials);
} catch (e) {
console.error(e.message);
@webjoaoneto
webjoaoneto / youtube-music.sh
Created March 20, 2018 01:40
Shell script to download youtube musics from command line and extract Mp3. Support playlists.
#!/bin/bash
youtube-dl -i -x -o '%(playlist_index)s-%(title)s.%(ext)s' -f bestaudio --audio-quality 0 --audio-format mp3 $1
##
# Use:
# copy past to /usr/local/bin folder
# ./youtube-music "url playlist"
##
@webjoaoneto
webjoaoneto / S3_Javascript_Uploader.js
Last active November 15, 2016 15:03
Simple Javascript File (In ecmascript format) that uploads files to Amazon S3 service. Upload an array of files in a new unique album. Aws-sdk requires json-loader
import AWS from 'aws-sdk';
var S3_BUCKET = 'Your_Bucket';
var S3_REGION = 'Your_Region';
var S3_KEY = 'AKIAAAAAAAAAAAAAAAAA';
var S3_SECRET = 'abcdefghihaosmdboasmdasdmapsodmapsodmaod';
AWS.config.update({
@webjoaoneto
webjoaoneto / pagseguro.js
Created July 5, 2016 20:58
Pagseguro JS
CheckoutCartao.StartSession(function () { //aqui rodamos um ajax no servidor e da o Pagseguro.setSessionid();
console.info("Executando via ");
PagSeguroDirectPayment.createCardToken({ //cria o token e da o retorno, OK!
brand: 'visa',
cardNumber: $('#inputCartaoNumero').val(),
cvv: $('#inputCartaoCvv').val(),
expirationMonth: $('#inputVencimentoMes').val().substr(0, 2),
expirationYear: $('#inputVencimentoMes').val().substr(5, 20),
success: function (e) { //aqui está o problema!
console.info(this);
Delivered-To: joaoneto@baratocoletivo.com.br
Received: by 10.25.79.85 with SMTP id d82csp1903143lfb;
Tue, 13 Oct 2015 05:15:34 -0700 (PDT)
X-Received: by 10.107.156.14 with SMTP id f14mr34386089ioe.32.1444738533914;
Tue, 13 Oct 2015 05:15:33 -0700 (PDT)
Return-Path: <0000015061208006-7abe6e68-568a-47a6-9769-5c907cde1451-000000@us-west-2.amazonses.com>
Received: from a27-66.smtp-out.us-west-2.amazonses.com (a27-66.smtp-out.us-west-2.amazonses.com. [54.240.27.66])
by mx.google.com with ESMTPS id a74si2679745ioa.193.2015.10.13.05.15.33
for <joaoneto@baratocoletivo.com.br>
<?php
return array(
'orm_default' => array(
'object_manager' => 'Doctrine\ORM\EntityManager',
'identity_class' => 'System\Entity\User',
'identity_property' => 'email',
'credential_property' => 'password',
'credential_callable' => array('System\Entity\User', 'checkPassword')
),
@webjoaoneto
webjoaoneto / css_resources.md
Created July 22, 2014 20:07 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@webjoaoneto
webjoaoneto / python_resources.md
Created July 22, 2014 20:07 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides