Skip to content

Instantly share code, notes, and snippets.

View martinlindhe's full-sized avatar
😸

Martin Lindhe martinlindhe

😸
View GitHub Profile
@martinlindhe
martinlindhe / App.vue
Created December 10, 2015 23:03
vue.js example
<template>
<div>
<nav-bar></nav-bar>
<cookie-info></cookie-info>
<router-view></router-view>
<corporate-footer></corporate-footer>
</div>
package main
import (
"bufio"
"fmt"
"image"
"image/draw"
"image/png"
"io/ioutil"
"log"
#!/bin/sh
#
# NOTE: this only works on OSX due to the syntax of the stat command
#
# brew install jpeg jpegoptim
inFile=$1
if [ -z $inFile ]; then
echo "Syntax: $0 filename"
#!/bin/sh
#
# NOTE: this only works on OSX due to the syntax of the stat command
#
# brew install pngcrush optipng
inFile=$1
if [ -z $inFile ]; then
echo "Syntax: $0 filename"
@martinlindhe
martinlindhe / days.go
Created January 25, 2016 14:27
days in month
func TestDaysInMonth(t *testing.T) {
assert.Equal(t, 29, daysInMonth(2016, time.February))
}
func daysInMonth(year int, mon time.Month) int {
t := time.Date(year, mon+1, 0, 0, 0, 0, 0, time.UTC)
return t.Day()
}
@martinlindhe
martinlindhe / MdlSelect.vue
Created February 1, 2016 20:43
vue-mdl-select
<style>
.getmdl-select .mdl-icon-toggle__label {
float:right;margin-top:-30px;color:gray
}
.getmdl-select.is-focused i.mdl-icon-toggle__label {
color:blue
}
.getmdl-select .mdl-menu__container {
width:100% !important
}
@martinlindhe
martinlindhe / .babelrc
Last active May 16, 2018 14:16
laravel + vue + webpack + eslint + godo
{
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"],
"comments": false
}
@martinlindhe
martinlindhe / MdlDialog.vue
Created February 4, 2016 15:22
<mdl-dialog> from mdl 1.1, for vue-mdl
<style>
/* for dialog-polyfill, from node_modules/dialog-polyfill/dialog-polyfill.css */
dialog {
position: absolute;
left: 0; right: 0;
width: -moz-fit-content;
width: -webkit-fit-content;
width: fit-content;
height: -moz-fit-content;
height: -webkit-fit-content;
@martinlindhe
martinlindhe / MdlSnackbar.vue
Created February 4, 2016 16:21
<mdl-snackbar> from mdl 1.1, for vue-mdl
<template>
<div aria-live="assertive" aria-atomic="true" aria-relevant="text" class="mdl-snackbar mdl-js-snackbar">
<div class="mdl-snackbar__text"></div>
<button class="mdl-snackbar__action" type="button"></button>
</div>
</template>
<script>
export default {
props: {
@martinlindhe
martinlindhe / .gitconfig
Last active December 6, 2018 22:53
.gitconfig fat fingers [alias] section qwerty keyboard. ymmv
# alias block from https://gist.github.com/martinlindhe/4c594db58b314d4c780b8fe614e73580
[alias]
a = add
ad = add
adfd = add
addd = add
dd = add
tadd = add
afdd = add
affd = add