Skip to content

Instantly share code, notes, and snippets.

<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>
/**
* 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
@whiteinge
whiteinge / base.js
Created July 5, 2012 20:10
A baseline JS toolbox for new projects
/**
* 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) {
@gustinmi
gustinmi / jstemplates2.html
Last active April 26, 2024 08:50
JavaScript Templating Full Edition (settings, localization, micro templates )
<!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;
@lindenb
lindenb / Delicious2Diigo.java
Created December 19, 2010 14:48
Save bookmarks from delicious to Diigo.com using the Diigo API.
/**
* Delicious2Diigo
*
* Author:
* Pierre Lindenbaum
* http://plindenbaum.blogspot.com
*
* Motivation:
* save bookmarks from delicious to diigo using the Diigo API.
*
@fproperzi
fproperzi / config.wsf.js
Last active April 26, 2024 08:48
wsf file and config to use in wsf files
// 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;
(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) :
@lukaskubanek
lukaskubanek / Bundle+TestFlight.swift
Last active April 26, 2024 08:48
A code snippet for detecting the TestFlight environment for a macOS app at runtime
/// 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:
// 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);
@ludorumjeoun
ludorumjeoun / sample.html
Last active April 26, 2024 08:47
md5 utf8_encode 의존성 제거함.
<!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">