#script created by Matt Anderson, http://tonkapark.com | |
require 'rubygems' | |
require 'bigcartel' | |
require 'csv' | |
# SET YOUR BIGCARTEL ID HERE | |
STORE = 'ugmonk' | |
# SET THE BEST NAME FOR ANY DROP DOWN OPTIONS |
//using the RazorEngine @http://razorengine.codeplex.com/ | |
// I am using this with ASP.NET forms (.NET 4.0) for email templates | |
// 1. Email HTML Templates Location: | |
// ~/templates/email/MyEmailTemplate.cshtml (name something useful like Page, Master where email is being sent) | |
//Helper methods - put this shit in a common helper class like below: | |
using RazorEngine; |
var crypto = require('crypto'); | |
var AESCrypt = {}; | |
AESCrypt.decrypt = function(cryptkey, iv, encryptdata) { | |
encryptdata = new Buffer(encryptdata, 'base64').toString('binary'); | |
var decipher = crypto.createDecipheriv('aes-256-cbc', cryptkey, iv), | |
decoded = decipher.update(encryptdata); |
/* | |
Given a date, tzAbbr returns a short, friendly name for the | |
user's time zone on that date, or an empty string if their | |
client's Intl support is missing or incomplete. | |
For example, a user in New York might see: | |
tzAbbr(new Date()) // => "EST" | |
Time zones are locale-dependent. Users traveling outside of |
<div id="page_container"> | |
<div id="main_content"> | |
<div class="front face"> | |
<!-- ALL THE SITE CONTENT GOES HERE --> | |
<header class="clearfix"> | |
-
Include Weather Icons in your app: https://github.com/erikflowers/weather-icons
-
Include the below JSON in your application, for example purposes, lets assume it's a global named
weatherIcons
. -
Make a request to OpenWeatherMap:
req = $.getJSON('http://api.openweathermap.org/data/2.5/weather?q=London,uk&callback=?');
@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {
var dispatchErrorEvent = (function IIFE(){ | |
var createErrorEvent; | |
try { | |
try { | |
new ErrorEvent("error",{}); | |
createErrorEvent = function createErrorEvent(err) { | |
return new ErrorEvent("error",{ | |
error: err, |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.