Skip to content

Instantly share code, notes, and snippets.

View jonsecchis's full-sized avatar

Jon Secchis jonsecchis

View GitHub Profile
@jonsecchis
jonsecchis / test.html
Created September 12, 2020 15:22
test downloadable html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
</head>
<body>
Test Downloadable HTML
</body>
</html>
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:robert@broofa.com
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
@jonsecchis
jonsecchis / script.js
Created September 2, 2020 20:07 — forked from bramus/script.js
List of valid HTML Elements
// Run this on https://developer.mozilla.org/en/docs/Web/HTML/Element
var tags = [], nodeList = document.querySelectorAll('td a code');
for (i in nodeList) {
if ((nodeList[i].innerText) && (nodeList[i].innerText.indexOf('<') > -1)) {
var tag = nodeList[i].innerText.replace('<','"').replace('>','"');
if (tags.indexOf(tag) == -1) {
tags.push(tag);
}
}
}
@jonsecchis
jonsecchis / generate-pushid.js
Created August 22, 2020 14:24 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@jonsecchis
jonsecchis / easing.js
Created October 16, 2019 04:41 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@jonsecchis
jonsecchis / rAF.js
Created October 5, 2019 02:41 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@jonsecchis
jonsecchis / sanfrancisco-font.css
Created September 17, 2019 08:00
San Francisco Web Font
/** WARNING - USE AT OWN RISK */
/** IT IS AGAINST APPLE'S POLICY TO USE SF PRO FOR ANYTHING OTHER THAN iOS/tvOS/macOS/watchOS DESIGN & DEVELOPMENT */
/** https://sf.abarba.me/font.css */
/** https://sf.abarba.me/LICENSE.pdf */
/** 1. Copy/import this file into your main css/scss file */
/** 2. Change css font-family: to "SF Text", "SF Display" or "SF Mono" */
/** 3. Apply font-weight or italic to html elements */
/** THANK YOU */
@jonsecchis
jonsecchis / hideDockDelayed.sh
Created July 30, 2018 17:13
pseudo-remove macOS Dock
defaults write com.apple.dock autohide -bool true && defaults write com.apple.dock autohide-deplay -float 5 && defaults write com.apple.dock autohide-time-modifier -float 0 && killall Dock
@jonsecchis
jonsecchis / sshAgent.sh
Created May 21, 2018 16:06
Start ssh-agent on CentOS
exec ssh-agent bash
@jonsecchis
jonsecchis / setPortCap.sh
Created March 26, 2018 18:10
Allow bin to listen to low-numbered ports w/o root privileges
sudo setcap CAP_NET_BIND_SERVICE=+eip `which ${binary}`