Instantly share code, notes, and snippets.

View ga.js
(function track (id) {
// prepare data
window.dataLayer = window.dataLayer || []
function gtag () { dataLayer.push(arguments) }
gtag('js', new Date())
gtag('config', id)
// load analytics
var script = document.createElement('script')
View App.vue
<template>
<ui-icon name="notes" />
<ui-icon name="book" />
<ui-icon name="map" />
</template>
View AddressForm.vue
<template>
<ui-form name="address">
<div class="fields">
<ui-input
name="house_no"
label="House name / no"
:value.sync="values.house_no"
View CarLoader.js
import Vue from 'vue'
import _ from 'lodash'
import { compare, stringify } from 'utils/query'
import store from 'app/store'
/**
* Car loader service
*
* Removes responsibility of loading cars from the results store
*
View 0. notes.md
View pythagorean-triples.js
// -----------------------------------------------------------------------------
// utils
function isPrime(value)
{
for(var i = 2; i < value; i++)
{
if(value % i === 0)
{
return false;
View rollup-jquery.js
/**
* Basic rollup setup for jQuery plugin development:
*
* - watch src folder
* - transpile ES6 to ES5
* - create development version (source maps)
* - create production version (minified)
*/
// dependencies
View console.txt
Foo > 1
Bar > 1
Bar (doubled) > 2
Bar (doubled, default message) > New value is: 2
Bar (doubled, custom message) > New custom value is: 2
Bar (doubled, default message, uppercase) > NEW VALUE IS: 2
Bar (doubled, custom message, uppercase) > NEW CUSTOM VALUE IS: 2
View MPlayerX Launcher.app
on run
do shell script "open -n /Applications/MPlayerX.app"
tell application "MPlayerX" to activate
end run
on open theFiles
repeat with theFile in theFiles
do shell script "open -na /Applications/MPlayerX.app " & quote & (POSIX path of theFile) & quote
end repeat
tell application "MPlayerX" to activate