Skip to content

Instantly share code, notes, and snippets.

@donpdonp
donpdonp / uTemplate.js
Created February 24, 2015 17:58
js micro templating
var _tmplCache = {}
this.parseTemplate = function(str, data) {
/// <summary>
/// Client side template parser that uses &lt;#= #&gt; and &lt;# code #&gt; expressions.
/// and # # code blocks for template expansion.
/// NOTE: chokes on single quotes in the document in some situations
/// use &amp;rsquo; for literals in text and avoid any single quote
/// attribute delimiters.
/// </summary>
/// <param name="str" type="string">The text of the template to expand</param>
@donpdonp
donpdonp / noaa.js
Last active February 16, 2024 07:34
noaa weather watch
(function() {
return {name:"noaa"}
})
var defaultZone = "ORZ006"
var alert_channel = "#pdxweather"
var major_alert_channel = "#portlandor"
function go(msg) {
var zone
@donpdonp
donpdonp / bigpipe.js
Last active January 17, 2024 03:38
gluon bigpipe
(function() {
return {
name: "bigpipe"
}
})
var old_percent = 0
var announce_channel = "#pdxbots"
function go(msg) {
@donpdonp
donpdonp / price.js
Last active January 5, 2024 03:47
gluon simple price watch
(function() {
setup()
return {
name: "price"
}
})
var dbkey = "price"
var alert_channel = "#zrobo"
var state = { watches: {} }
@donpdonp
donpdonp / coin.js
Last active December 31, 2023 08:02
gluon coinmarketcap coin price
(function() {
setup()
return {
name: "coin"
}
})
var etherscan_apikey
var coingecko_apikey
var cache_date = new Date(0)
@donpdonp
donpdonp / gist:2258175
Created March 31, 2012 00:28
sublime text 2 Slim
donp@sparky:~/.config/sublime-text-2/Packages$ git clone git://github.com/fredwu/ruby-slim-tmbundle.git Ruby-Slim.tmbundle
Cloning into Ruby-Slim.tmbundle...
remote: Counting objects: 142, done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 142 (delta 89), reused 114 (delta 61)
Receiving objects: 100% (142/142), 21.44 KiB, done.
Resolving deltas: 100% (89/89), done.
donp@sparky:~/.config/sublime-text-2/Packages$ ls Ruby-Slim.tmbundle/
Commands info.plist Preferences README.md Snippets Syntaxes
donp@sparky:~/.config/sublime-text-2/Packages$
@donpdonp
donpdonp / gist:4997294
Created February 20, 2013 17:25
bitcoin-qt command line arguments
$ bitcoin-qt --help
Bitcoin-Qt version v0.7.2-beta
Usage:
bitcoin-qt [command-line options]
Options:
-? This help message
-conf=<file> Specify configuration file (default: bitcoin.conf)
-pid=<file> Specify pid file (default: bitcoind.pid)
@donpdonp
donpdonp / jwt.js
Created July 12, 2023 16:30
gluon jwt
// if this is your Base64 encoded string
var str = 'VGhpcyBpcyBhbiBhd2Vzb21lIHNjcmlwdA==';
// make URL friendly:
str = str.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=+$/, '');
// reverse to original encoding
str = (str + '===').slice(0, str.length + (str.length % 4));
str = str.replace(/-/g, '+').replace(/_/g, '/');
(function() {
setup()
return {name:"ai"}
})
var sessionKey
function setup() {
}
@donpdonp
donpdonp / tls.js
Last active June 28, 2023 16:51
gluon tls ssl checks
(function() {
setup()
return {name:"tls"}
})
var alert_channel = "#pdxbots"
var watchlist = {}
var key = "tls:watchlist"
function setup() {