Skip to content

Instantly share code, notes, and snippets.

View seanstappas's full-sized avatar

Sean Stappas seanstappas

View GitHub Profile
@dusanmarsa
dusanmarsa / clipboard-paste-image.js
Created October 29, 2017 08:43
JavaScript - Clipboard API - Paste image handler
var IMAGE_MIME_REGEX = /^image\/(p?jpeg|gif|png)$/i;
var loadImage = function (file) {
var reader = new FileReader();
reader.onload = function(e){
var img = document.createElement('img');
img.src = e.target.result;
var range = window.getSelection().getRangeAt(0);
range.deleteContents();
@marcaurele
marcaurele / cloud-config.md
Last active August 5, 2022 06:35
Cloud-init configurations (#cloud-config)

Cloud-Init configurations for Exoscale

Automatic EIP

Having an EIP 159.100.241.235 it allows to automatically configure it and use it for SSH access after deployment, for CentOS.

#cloud-config
write_files:
-   content: |
@th0ma5w
th0ma5w / easing.py
Created March 31, 2014 01:32
Easing Equations in Python (orig by Robert Penner)
# ported from http://www.gizma.com/easing/
# by http://th0ma5w.github.io
#
# untested :P
import math
linearTween = lambda t, b, c, d : c*t/d + b