Skip to content

Instantly share code, notes, and snippets.

View rhernandog's full-sized avatar
🐯

Rodrigo Hernando rhernandog

🐯
View GitHub Profile
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@antishok
antishok / auth-popup-callback.html
Last active May 20, 2023 09:23
passport popup login
<!doctype html>
<html>
<head><title>Log-In</title></head>
<script>
if (window.opener) {
window.opener.postMessage("popup-done", "*");
setTimeout(function() { window.close() }, 0);
}
</script>
</head>
@nepsilon
nepsilon / git-change-commit-messages.md
Last active April 19, 2024 02:23
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@amnuts
amnuts / phpstorm.bat
Last active June 22, 2021 17:04
Add context menu to Windows 7 to open file/folder in PhpStorm
@echo off
SET PhpStormPath=C:\Program Files (x86)\JetBrains\PhpStorm 8.0.2\bin\PhpStorm64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f
echo Adding folder entries
@raldred
raldred / TweenMax.SVGJSPlugin.js
Last active December 30, 2015 03:28
svg.js plugin for TweenMax, heavily based on the Raphael plugin.
/*!
* VERSION: 0.0.1
* DATE: 2013-12-03
*
* @description: Plugin to manipulate transform properties of SVGJS objects, heavily based on the RaphaelPlugin
*
* @author: Rob Aldred, raldred@gmail.com
*/
(window._gsQueue || (window._gsQueue = [])).push( function() {
@dillmo
dillmo / SASS mixins for vendor prefixes
Last active May 8, 2018 22:01
SASS: vendor prefix mixins
@mixin vendor-prefix($property, $value)
-webkit-#{$property}: $value
-moz-#{$property}: $value
-ms-#{$property}: #{$value}
-o-#{$property}: #{$value}
#{$property}: #{$value}
@mixin value-vendor-prefix($property, $value)
#{$property}: -webkit-#{$value}
#{$property}: -moz-#{$value}
@papucho
papucho / file.html
Created April 18, 2013 20:59
Grayscale filter using SVG+CSS
<img src="http://lorempixel.com/400/200/sports/" alt="" class="fader">
@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@kevinSuttle
kevinSuttle / meta-tags.md
Last active March 31, 2024 14:26 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags