Skip to content

Instantly share code, notes, and snippets.

@kaheglar
kaheglar / render-ko.js
Created March 15, 2017 14:39
Knockout server-side rendering.
const domino = require('domino');
const html = `
<!DOCTYPE html>
<html>
<body>
<ul data-bind="foreach: list">
<li data-bind="text: $data"></>
</ul>
@ibratoev
ibratoev / updateTypings.js
Created August 25, 2016 11:58
JS script to update typings
#!/usr/bin/env node
// Script to update typings to their latest versions.
// Note that it should be executed in the folder where typings.json is.
const { exec, execSync } = require('child_process');
const path = require('path');
const typings = require(path.join(process.cwd(), 'typings.json'));
exec('typings ls', (error, _, stderr) => {
if (error) {
@jarthod
jarthod / browser-mockup.png
Last active October 31, 2022 09:23
Pure CSS browser mockups
browser-mockup.png
/******************************************************************************
jquery.transformable.js v0.3.4 copyright 2013 Aaron Flin (aaron at flin dot org).
- fixed test for mozillaOverflowHiddenBug, which would improperly always return true
- todo: fix the parseFloat(computedStyle.[top|left]) in jQuery.fn.transformable.offsetNoGetBounds
so that it can handle %, or better yet, figure out a better way. Without a fix, I think
older Mozilla browsers will choke on a div with offsetParents that are not positioned in 'px'
jquery.transformable.js v0.3.3 copyright 2013 Aaron Flin (aaron at flin dot org).
- added initial support for dragging sortables in transformed divs.
@ykessler
ykessler / timezones
Created August 14, 2012 14:50
JSON list of time zones (Based on Olson tz database)
[
{"group":"US (Common)",
"zones":[
{"value":"America/Puerto_Rico","name":"Puerto Rico (Atlantic)"},
{"value":"America/New_York","name":"New York (Eastern)"},
{"value":"America/Chicago","name":"Chicago (Central)"},
{"value":"America/Denver","name":"Denver (Mountain)"},
{"value":"America/Phoenix","name":"Phoenix (MST)"},
{"value":"America/Los_Angeles","name":"Los Angeles (Pacific)"},
{"value":"America/Anchorage","name":"Anchorage (Alaska)"},
@ksafranski
ksafranski / Common-Currency.json
Last active June 3, 2024 04:02
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@govert
govert / gist:1378887
Created November 19, 2011 14:29
Excel-DNA Dynamic Code from string
<DnaLibrary Name="ExcelDna Test Dynamic Method" Language="C#">
<Reference Name="System.Windows.Forms" />
<![CDATA[
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using Microsoft.CSharp;