Skip to content

Instantly share code, notes, and snippets.

View aranajhonny's full-sized avatar
🏠
Working from home

Jhonny aranajhonny

🏠
Working from home
View GitHub Profile
@aranajhonny
aranajhonny / interval.js
Created September 17, 2020 21:54 — forked from ncou/interval.js
setTimeout and setInterval with pause and resume
// http://stackoverflow.com/questions/7279567/how-do-i-pause-a-window-setinterval-in-javascript
function RecurringTimer(callback, delay) {
var timerId, start, remaining = delay;
this.pause = function() {
window.clearTimeout(timerId);
remaining -= new Date() - start;
};
@aranajhonny
aranajhonny / tor-openvpn.sh
Created January 6, 2020 21:54 — forked from kremalicious/tor-openvpn.sh
Install and configure Tor as proxy for all OpenVPN server traffic
# what we want:
# client -> OpenVPN -> Tor -> Internet
# Install & configure OpenVPN
# https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04
# assumed OpenVPN configuration
# 10.8.0.1/24-Subnet
# tun0-Interface
@aranajhonny
aranajhonny / lazy-video-loader.js
Created February 28, 2019 13:26 — forked from benrobertsonio/lazy-video-loader.js
Lazy Loading Video Based on Connection Speed
class LazyVideoLoader {
constructor() {
this.videos = [].slice.call(document.querySelectorAll('.hero__bgvideo'));
// Abort when:
// - The browser does not support Promises.
// - There no videos.
// - If the user prefers reduced motion.
// - Device is mobile.
if (
{
"autocomplete": true,
"autoimport": true,
"enable_auto_align": false,
"format_on_save": true,
"ignore": "Parent",
"indent_with_space": 4,
"passes":
[
"ReindentSwitchBlocks",
@aranajhonny
aranajhonny / 0_reuse_code.js
Created December 30, 2016 05:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aranajhonny
aranajhonny / README.md
Created August 30, 2016 21:05 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage