Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<style type="text/css"> | |
tr.had { color: #888; } | |
</style> | |
<script type="text/html" id="beer_row"> | |
<% var d = new Date(obj.updated * 1000); now = new Date(); %> | |
<tr <%= (Beerradar.myRatings.indexOf(parseInt(obj.beer.ratings[0].id)) > -1) ? 'class="had"' : '' %>> | |
<td><%= Math.round((now.getTime() - d.getTime()) / 86400000) %> days</td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adapted from the official plugin text.js | |
* | |
* Uses UnderscoreJS micro-templates : http://documentcloud.github.com/underscore/#template | |
* @author Julien Cabanès <julien@zeeagency.com> | |
* @version 0.2 | |
* | |
* @license RequireJS text 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. | |
* Available via the MIT or new BSD license. | |
* see: http://github.com/jrburke/requirejs for details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Allow Prototypal inheritance | |
* http://javascript.crockford.com/prototypal.html | |
* @author Douglas Crockford | |
* @version 2008-04-07 | |
* @param oldObject | |
* @return newObject | |
*/ | |
if (typeof Object.create !== 'function') { | |
Object.create = function (o) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>templator2</title> | |
<style type="text/css"> | |
html, body { | |
font-size: 14px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Delicious2Diigo | |
* | |
* Author: | |
* Pierre Lindenbaum | |
* http://plindenbaum.blogspot.com | |
* | |
* Motivation: | |
* save bookmarks from delicious to diigo using the Diigo API. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/questions/34882591/upgrading-iis-classic-asp-javascript-jscript-scripting-engines-to-chakra | |
var _htmlfile = WScript.CreateObject('htmlfile'); | |
_htmlfile.write('<meta http-equiv="x-ua-compatible" content="IE=11" />'); | |
// expose more modern methods from htmlfile | |
var JSON = _htmlfile.parentWindow.JSON; | |
String.prototype.trim = _htmlfile.parentWindow.String.prototype.trim; | |
String.prototype.padStart = _htmlfile.parentWindow.String.prototype.padStart; | |
Array.prototype.indexOf = _htmlfile.parentWindow.Array.prototype.indexOf; | |
Array.prototype.forEach = _htmlfile.parentWindow.Array.prototype.forEach; | |
Array.prototype.map = _htmlfile.parentWindow.Array.prototype.map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var cache = {}; | |
this.tmpl = function tmpl(str, data){ | |
// Figure out if we're getting a template, or if we need to | |
// load the template - and be sure to cache the result. | |
var fn = !/\W/.test(str) ? | |
cache[str] = cache[str] || | |
tmpl(document.getElementById(str).innerHTML) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// MIT License | |
/// | |
/// Copyright (c) 2021 Lukas Kubanek, Structured Path GmbH | |
/// | |
/// Permission is hereby granted, free of charge, to any person obtaining a copy | |
/// of this software and associated documentation files (the "Software"), to deal | |
/// in the Software without restriction, including without limitation the rights | |
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
/// copies of the Software, and to permit persons to whom the Software is | |
/// furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// myapp.js | |
$(function() { | |
var tabs=function(id) { | |
$(".tab").removeClass("active").filter(".tab[href*='" + id + "']").addClass("active"); | |
$(".tabview").hide().filter("#" + id).show(); | |
} | |
window.realDate=function(timestamp) { | |
var date = new Date(timestamp*1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<link rel="stylesheet" href=""> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script> | |
<script type="text/javascript" src="simplate.js"></script> | |
<script type="text/javascript"> |
NewerOlder