Skip to content

Instantly share code, notes, and snippets.

View willywongi's full-sized avatar

Francesco Pongiluppi willywongi

View GitHub Profile
@willywongi
willywongi / index.js
Created March 25, 2015 10:48
Function returning the same promise as long it's not fullfilled/rejected.
function getSomething() {
/**
* Returns a promise that fullfills in 15 seconds
**/
if (getSomething._promise) {
return getSomething._promise;
} else {
return getSomething._promise = new Promise(function(resolve, reject) {
setTimeout(function() {
getSomething._promise = null;
@willywongi
willywongi / index.html
Last active December 27, 2017 09:47
This is actually a test
<!DOCTYPE html>
<html class="ynap-fe-exercise" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
<link href="index.css" rel="stylesheet">
<script src="index.js"></script>
<script id="ynap-news-story-tmpl" type="text/x-template">
@willywongi
willywongi / easings.css
Created July 24, 2020 14:04 — forked from argyleink/easings.css
Handy CSS properties for easing functions
:root {
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19);
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22);
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335);
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
@willywongi
willywongi / logging_config.py
Created March 8, 2021 16:57
Python logging configuration example
import logging
import logging.config
logging.dictConfig({
'version': 1,
'disable_existing_loggers': False,
"formatters": {
"standard": {
"format": '%(asctime)s %(name)s %(levelname)s %(message)s'
}
@willywongi
willywongi / deploy-to.sh
Created November 27, 2024 16:13
Fork (Git client) custom command
is_stash_needed=$(git status -s)
if [ -n "$is_stash_needed" ]
then
git stash push
fi
git checkout $1{ref}
git merge ${ref}