Skip to content

Instantly share code, notes, and snippets.

View lsgalves's full-sized avatar
🧯

Leonardo Galves lsgalves

🧯
  • Skymail
  • São Paulo, Brazil
  • 21:35 (UTC -03:00)
View GitHub Profile
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@agmm
agmm / nextjs-file-upload-api.js
Created January 31, 2020 23:03
Simple Nextjs File Upload — Backend API
// Backend
import formidable from 'formidable';
export const config = {
api: {
bodyParser: false,
},
};
export default async (req, res) => {
@maxkostinevich
maxkostinevich / dev.yml
Last active March 12, 2024 17:18
Github Actions - Deploy Serverless Framework (AWS)
#
# Github Actions for Serverless Framework
#
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings
# If you're using env.yml file, store its content as ENV Github secret
#
# Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD
#
# Learn more: https://maxkostinevich.com/blog/how-to-deploy-serverless-applications-using-github-actions/
#
@amake
amake / innosetup-linux-macos.org
Last active July 2, 2024 15:48
Inno Setup on Linux and macOS

Inno Setup on Linux and macOS

Inno Setup is a popular installer builder for Windows. Of course it is made to run on Windows only, by default. But what if you want to build Windows installers off Windows, i.e. on Linux or macOS?

You’re in luck: It’s possible to run Inno Setup anywhere that Docker runs (including Linux and macOS), and even have a passable experience writing your setup script.

@srph
srph / WindowVhSetter.tsx
Created June 20, 2019 10:04
React: 100vh css variable workaround for mobile (https://css-tricks.com/the-trick-to-viewport-units-on-mobile/)
import { useEffect } from 'react'
import useWindowSize from 'react-use/lib/useWindowSize'
/**
* @NOTE Don't mount this twice; only on the root node.
*/
function WindowVhSetter() {
const {height} = useWindowSize()
@drewchapin
drewchapin / Template.nsi
Created February 20, 2018 19:09
Template for modern NSIS installation script
;-------------------------------------------------------------------------------
; Includes
!include "MUI2.nsh"
!include "LogicLib.nsh"
!include "WinVer.nsh"
!include "x64.nsh"
;-------------------------------------------------------------------------------
; Constants
!define PRODUCT_NAME "My Application"
@jameswpm
jameswpm / pomodoro.sh
Last active December 27, 2023 15:53
Minimalistic Pomodoro Timer
#!/bin/bash
#
# Minimalistic_Pomodoro_Timer
#
# Based on the SU answer found here: https://superuser.com/questions/224265/pomodoro-timer-for-linux/669811#669811
#
# Tested in Ubuntu 16.04 and Arch
pomodorotime () {
notify-send "Time to Work" "Focus" -u normal -a 'Pomodoro' -i $HOME/Documentos/icon.png
paplay /usr/share/sounds/freedesktop/stereo/window-attention.oga
@mkjiau
mkjiau / axios-interceptors-refresh-token.js
Last active March 13, 2024 10:59
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
@krisleech
krisleech / 00-README.md
Created August 3, 2017 11:43
UptimeRobot Ansible and v2 API notes

When an interger is sent for monitor>type an internal error occurs. If a string is sent as in the main.yml example it is okay.

When an internal error occurs a 200 response not 500 is sent.

When an error occurs (e.g. monitor already exists) a 200 response is sent.

@mfd
mfd / GTWalsheimPro.css
Last active May 3, 2024 16:52
GT Walsheim Pro
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Regular"),local("GTWalsheimProRegular"),url(GTWalsheimProRegular.woff2) format("woff2"),url(GTWalsheimProRegular.woff) format("woff"),url(GTWalsheimProRegular.ttf) format("truetype");
font-weight: 400;
font-style: normal
}
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Bold"),local("GTWalsheimProBold"),url(GTWalsheimProBold.woff2) format("woff2"),url(GTWalsheimProBold.woff) format("woff"),url(GTWalsheimProBold.ttf) format("truetype");