Skip to content

Instantly share code, notes, and snippets.

@kevin-smets
kevin-smets / landscapeLock.coffee
Created June 12, 2013 20:01
mobile webkit landscape locking hack
$(window).bind("orientationchange", ->
$scope.orientation = window.orientation
$(document.body).css({
width: $(window).width()
height: $(window).height()
})
if window.orientation % 180 is 0
rotation = "rotate(-90deg)"
if window.orientation > 0
@kevin-smets
kevin-smets / harp_and_browser-sync_combo.md
Last active September 21, 2017 23:40
harp + browsers-sync, start developing for the web in under a minute (probably ;) )

What is this combo?

Static file server with livereload, preprocessors, synchronised testing over multiple browser instances and batteries included. This setup uses Harp and Browsersync, hence the name.

Prerequisite

You will need node, install it if you haven't already.

Init all the things

@kevin-smets
kevin-smets / gitConvertSassToScss.sh
Created March 1, 2015 21:57
Converts all sass files (recursively) to scss in a git repo (rename should get picked up so history is still tied to the converted file).
find . -type f -name "*.sass" -exec bash -c 'sass-convert ${0} -i --to scss; git mv ${0} ${0%.sass}.scss' {} \;
@kevin-smets
kevin-smets / csslint.clean.json
Last active September 21, 2017 23:41
CSS lint options for the modern browser(s)
{
"box-model" : true,
"display-property-grouping" : true,
"duplicate-properties" : true,
"empty-rules" : true,
"known-properties" : true,
"non-link-hover" : false,
"adjoining-classes" : false,
"box-sizing" : false,
"compatible-vendor-prefixes" : true,
@kevin-smets
kevin-smets / gitSemVer.sh
Last active September 21, 2017 23:42
SemVer tagging
git tag -a v1.0.0 -m 'tagging v1.0.0'
git push --tags
@kevin-smets
kevin-smets / svgo.md
Last active October 13, 2017 06:45
svgo all the things
# NO sudo
npm i -g svgo

# Go to a directory with svg's (also searches subdirectories)
find . -name '*.svg' -exec svgo -i {} \
@kevin-smets
kevin-smets / one-line-asset-servers.md
Last active October 21, 2017 06:09
One liners for CLI asset servers

Https / Http2

Caddy

macOS: brew install caddy

caddy --conf=<( echo -e ':8080\ntls self_signed' )

Make sure to use https://, otherwise you'll download a.. download file. Since it's self signed, you'll need to ignore any security warnings in order to continue.

[
{
"imageUrl": "http://placekitten.com/2000/200",
"title": "Article 2",
"date": "20/02/2018",
"body": "Bacon ipsum dolor amet shankle drumstick tenderloin, leberkas tri-tip corned beef jowl. Short ribs cupim biltong, kielbasa filet mignon brisket sirloin prosciutto pork belly shank pig."
},
{
"title": "Article 1",
"date": "19/02/2018",
@kevin-smets
kevin-smets / README.md
Last active June 4, 2018 13:44
Install TensorFlow @ MacOS

Instructions

# Install python 3.x
brew ugrade python

# Install TF - see https://github.com/tensorflow/tensorflow/issues/17369
pip3 install grpcio==1.9.1 tensorflow
#!/bin/bash
for f in *.sass; do sass-convert $f ${f%sass}scss ; done
rm *.scss