Skip to content

Instantly share code, notes, and snippets.

@fsboehme
fsboehme / countdown-redirect.html
Last active December 11, 2020 15:44 — forked from Joel-James/countdown-redirect.html
Countdown Redirect Using JavaScript - with Cancel
<!-- Modify this according to your requirement -->
<p id="countdown-wrapper">
Redirecting in <span id="countdown">10</span> seconds.
<a href="#" onclick="stopCountdown();return false;">Cancel</a>
</p>
<!-- JavaScript part -->
<script type="text/javascript">
// Total seconds to wait
var seconds = 10;
@fsboehme
fsboehme / cryptopia_notify.js
Last active July 20, 2018 15:17
Simple trade notification for Cryptopia.
// This script will monitor your trades on Cryptopia.
// You'll get alerted (in Terminal and via voice prompt) when a new trade is executed.
// Save locally, add your api key, and run with "node <script name>" in Terminal.
// If you don't have node installed
// - on Mac (assuming Homebrew installed): brew install node
// - on Windows: http://blog.teamtreehouse.com/install-node-js-npm-windows
// Install other packages used:
@fsboehme
fsboehme / openOrderMonitor.js
Last active July 20, 2018 17:34 — forked from codeninja/openOrderMonitor.js
Node JS Script to check Binance for open orders and notify when they are filled.
// This script will monitor your open orders on Binance.
// You'll get alerted (in Terminal and via voice prompt) when an order changes status (e,g, filled, canceled).
// Save locally, add your api key, and run with "node <script name>" in Terminal.
// If you don't have node installed:
// brew install node
// Install other packages used:
// npm i requirejs binance-api-node say dateformat
@fsboehme
fsboehme / collapsespacestag.py
Last active June 8, 2018 13:11 — forked from jimmydo/collapsespacestag.py
collapsespaces is a Django template tag that collapses whitespace characters between tags into one space. This fork also strips leading whitespace on any new line and any whitespace between HTML attributes (e.g. id="foo" class="bar").
"""
collapsespaces is a Django template tag that collapses whitespace characters between tags into one space.
It is based on Django's 'spaceless' template tag (spaceless is different in that it completely removes whitespace between tags).
Why is this important?
Given "<span>5</span> <span>bottles</span>", collapsespaces will preserve the space between the two span elements--spaceless will not.
In a web browser:
"<span>5</span> <span>bottles</span>" renders as "5 bottles"
"<span>5</span><span>bottles</span>" renders as "5bottles"