Skip to content

Instantly share code, notes, and snippets.

Kevin Smets kevin-smets

View GitHub Profile
@kevin-smets
kevin-smets / landscapeLock.coffee
Created Jun 12, 2013
mobile webkit landscape locking hack
View landscapeLock.coffee
$(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 Sep 21, 2017
harp + browsers-sync, start developing for the web in under a minute (probably ;) )
View harp_and_browser-sync_combo.md

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 Mar 1, 2015
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).
View gitConvertSassToScss.sh
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 Sep 21, 2017
CSS lint options for the modern browser(s)
View csslint.clean.json
{
"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 Sep 21, 2017
SemVer tagging
View gitSemVer.sh
git tag -a v1.0.0 -m 'tagging v1.0.0'
git push --tags
@kevin-smets
kevin-smets / svgo.md
Last active Oct 13, 2017
svgo all the things
View svgo.md
# 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 Oct 21, 2017
One liners for CLI asset servers
View one-line-asset-servers.md

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.

View feed.en.json
[
{
"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 Jun 4, 2018
Install TensorFlow @ MacOS
View README.md

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
View sass2scss.sh
#!/bin/bash
for f in *.sass; do sass-convert $f ${f%sass}scss ; done
rm *.scss
You can’t perform that action at this time.