Skip to content

Instantly share code, notes, and snippets.

View TizioFittizio's full-sized avatar
Oi, ln apnbp, W xfhx tkr zrf ro gul rlhvbv r zlzwq kigg, mgcm k zvqt usr =)

Luca Campana TizioFittizio

Oi, ln apnbp, W xfhx tkr zrf ro gul rlhvbv r zlzwq kigg, mgcm k zvqt usr =)
  • Synopsys
  • Glasgow, Scotland
View GitHub Profile
@gre
gre / easing.js
Last active June 27, 2024 15:37
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@wesleybliss
wesleybliss / docker-compose-node-mongo.yml
Created September 9, 2016 21:37
Docker Compose with example App & Mongo
version: '2'
services:
myapp:
build: .
container_name: "myapp"
image: debian/latest
environment:
- NODE_ENV=development
- FOO=bar
volumes:
@B-Galati
B-Galati / tmux.sh
Last active September 8, 2022 13:00
tmux script example
#!/bin/bash
tmux has-session -t dev
if [ $? != 0 ]
then
tmux new-session -s dev -n "TEST" -d
tmux split-window -h -t dev:0
tmux split-window -v -t dev:0.1
tmux send-keys -t dev:0.0 'cd ~/foo/bar' C-m
tmux send-keys -t dev:0.1 'autossh -M 0 -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" test@test -t "cd ~/bar;bash"' C-m
@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 😨
// workaround for https://github.com/ionic-team/ionic/issues/13294
// probably breaks iPhone X support
.ios ion-nav > .ion-page > .toolbar.statusbar-padding:first-child,
.ios ion-nav > .ion-page > ion-header > .toolbar.statusbar-padding:first-child,
.ios ion-tab > .ion-page > .toolbar.statusbar-padding:first-child,
.ios ion-tab > .ion-page > ion-header > .toolbar.statusbar-padding:first-child,
.ios ion-tabs > .ion-page.tab-subpage > ion-header > .toolbar.statusbar-padding:first-child,
.ios ion-menu > .menu-inner > .toolbar.statusbar-padding:first-child,
.ios ion-menu > .menu-inner > ion-header > .toolbar.statusbar-padding:first-child {
padding-top: calc(20px + 4px) !important;