Skip to content

Instantly share code, notes, and snippets.

View vnys's full-sized avatar

Victor Nystad vnys

View GitHub Profile
@vnys
vnys / browserslist
Created December 21, 2016 08:00
Config for autoprefixer, legges i roten av prosjektet
# Amedia Utvikling
last 1 chrome versions
last 1 ff versions
last 1 edge versions
safari 7-10
ios_saf 7-10
chrome 38
chrome 34
ie 11
@vnys
vnys / fish-path.md
Last active June 14, 2017 09:44
Fish function for cloning from a Github repo. Usage: gc batfink/foo or gc batfink/foo bar (clones foo into bar)

set -U fish_user_paths /usr/local/bin $fish_user_paths

@vnys
vnys / automatic-uid.md
Created July 24, 2016 10:56
Prismic bugs

adfasf

@vnys
vnys / mdless.md
Last active July 12, 2016 08:05
colour-coded markdown-files in the terminal

Last ned get-pip.py

Kjør følgende (med sudo om nødvendig)

$ gem install mdless
$ python python get-pip.py
$ pip install Pygments
$ mdless README.md
@vnys
vnys / mongo-autostart-osx.md
Created June 10, 2016 10:00 — forked from subfuzion/mongo-autostart-osx.md
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@vnys
vnys / auto-deploy.md
Created May 7, 2016 04:38 — forked from domenic/0-github-actions.md
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

@vnys
vnys / validate.js
Last active April 21, 2016 15:39
Node validation with Joi, only allow env if ext eq json
'use strict';
const Joi = require('joi');
module.exports.env = Joi.when( 'ext', { is: 'json', then: Joi.boolean().optional().default(false), otherwise: Joi.forbidden() } );
module.exports.ext = Joi.string().regex(/^(json|html)$/).lowercase().trim().required();
module.exports.debug = Joi.object({
env: this.env,
ext: this.ext
@vnys
vnys / aa.md
Last active April 25, 2016 14:09
Plussicon

Original

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 31 31" style="enable-background:new 0 0 31 31;" xml:space="preserve">
<style type="text/css">
	.st0{fill:#FFFFFF;}
</style>
@vnys
vnys / tmux-cheatsheet.markdown
Last active March 2, 2016 10:41 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@vnys
vnys / streams.js
Last active February 2, 2016 13:04
streams
const stream = require('stream');
let readable = new stream.Readable({
objectMode: true,
read: function() {
let arr = [ { a: 1 }, { b: 1 }, { c: 1 } ];
arr.forEach( item => { this.push(item) });
this.push(null);
}
}).on('end', function() {