Skip to content

Instantly share code, notes, and snippets.

View philippeoz's full-sized avatar
🙃
Dinâmico

Philippe Gonzaga philippeoz

🙃
Dinâmico
View GitHub Profile
@Ronnasayd
Ronnasayd / client.js
Last active September 24, 2021 18:28
Exemplo de como fazer o refresh token com axios
import axios from "axios";
import { getBaseURL } from "./config";
export const client = axios.create({
baseURL: getBaseURL()
});
// for multiple requests
let isRefreshing = false;
let failedQueue = [];
@MichaelPolla
MichaelPolla / github-resize-pictures.md
Last active April 10, 2024 19:27
Markdown - Resize pictures in GitHub, including in comments comment

Markdown - Resize pictures in GitHub

I found that the "best" way is to use HTML, as it works both in Readme/.md files and also in comments (within Issues, Gist...)

E.g. when adding/editing a comment (within Issues, Gist...) :

  • Upload the picture by drag-and-drop in the text field
  • replace ![image](https://your-image-url.type) with <img src="https://your-image-url.type" width="100" height="100">

As mentioned by @cbestow (thanks!), it's not mandatory to set both width and height. If only one is set, the other will be adjusted accordingly to preserve the aspect ratio of the image.

@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@fernandosavio
fernandosavio / pt-br.js
Created September 1, 2014 13:09
Locale pt-br of Moment.js
// moment.js locale configuration
// locale : brazilian portuguese (pt-br)
// author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}