Skip to content

Instantly share code, notes, and snippets.

View vnys's full-sized avatar

Victor Nystad vnys

View GitHub Profile
@vnys
vnys / package.json
Created September 22, 2015 11:36
npm scripts for bundling and transpiling es6 modules, with babel, rollup and postcss
{
"author": "Victor Nystad",
"scripts": {
"postinstall": "./node_modules/bower/bin/bower install && npm start",
"start": "npm run watch:js & npm run watch:css & npm run serve",
"preserve": "npm run build:js & npm run build:css",
"serve": "browser-sync start --server www --server dist --server bower_components --files 'dist/*, www/*'",
"watch:js" : "chokidar 'index.js' -c 'npm run build:js'",
"watch:css" : "chokidar 'css/*.css' -c 'npm run build:css'",
"build:js": "mkdir -p dist && rollup index.js | babel -m umd --module-id fotballdataElements -o dist/test.js",
@vnys
vnys / app.js
Created September 29, 2015 10:24 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@vnys
vnys / cubic-asymmetric.svg
Last active November 1, 2015 11:23
Handcoded SVG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vnys
vnys / heart.svg
Last active November 2, 2015 08:40
handcoded heart svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vnys
vnys / graphic.svg
Last active November 2, 2015 12:31
svg with params
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vnys
vnys / draft.md
Created November 7, 2015 21:49 — forked from jsvine/draft.md
Why I love Tabletop.js but don't use it in production

Tabletop.js is a fantastic, open-source JavaScript library that lets developers easily integrate data from Google Spreadsheets into their online projects. I've used it, even contributed a minor feature, and love it for prototyping. Non-programmers love being able to update a project via Google Spreadsheets' hyper-intuitive interface.

That said, I'm extraordinarily wary of using Tabletop in production. Instead, at the Wall Street Journal, we use a bit of middleware to "prune" our Google Spreadsheets-based data and then cache it on our own servers. A few brief reasons:

@vnys
vnys / regex.js
Created November 8, 2015 08:41
Treningslog regex
'3 x 10 x 10 min 2kg '.match(/(\d+\s?[x|min|kg]+)/g).forEach(match => console.log(match.replace(/\s/,'').match(/(\d+)(\w+)/)))
@vnys
vnys / cellar.svg
Last active November 11, 2015 20:55
Cellar
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vnys
vnys / exiftool.md
Last active October 14, 2016 05:51
exiftool

Navngi filer med samme konvensjon som brukes av DropBox i Camera Upload.

cd <photo-directory>
exiftool "-FileName<CreateDate" -d "%Y-%m-%d %H.%M.%S%%-c.%%le" .
@vnys
vnys / css-nesting.md
Last active December 1, 2015 08:21
css-nesting

###css nesting polyfill

Input

.main {
	@nest & a {
		text-decoration: none;
	}
}