Skip to content

Instantly share code, notes, and snippets.

View hansv's full-sized avatar

Hans verschooten hansv

View GitHub Profile
In my layouts file I have:
{% helpers.includeSvg(page.fileSlug) %}
const fs = require('fs');
In helpers.js
module.exports = {

Keybase proof

I hereby claim:

  • I am hansv on github.
  • I am hansv (https://keybase.io/hansv) on keybase.
  • I have a public key ASDdMXLziL1FE9Ej-7TIsYpnJSfhusAcaN5isZkk5jbMlQo

To claim this, I am signing this object:

@hansv
hansv / so-35093397.elm
Last active June 1, 2016 22:06 — forked from freakingawesome/so-35093397.elm
Updated Autocomplete example to Elm 0.17
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Html.App as Html
import Task
import Char
import String exposing (..)
type alias Model =
@hansv
hansv / Pause Rdio and iTunes
Last active December 18, 2015 19:29
Very naive implementation of pausing Rdio and iTunes when they are playing. Now checks to see if the apps are running.
if application "Rdio" is running then
tell application "Rdio"
try
set whatshappening to (get player state as string)
end try
if whatshappening = "playing" then
pause
end if
end tell
@hansv
hansv / hamlhtml5boilerplate.html.haml
Created August 4, 2011 09:11 — forked from neiled/hamlhtml5boilerplate.html.haml
My haml version of the html 5 boiler plate code
!!! 5
/[if lt IE 7] <html lang="en" class="no-js ie6">
/[if IE 7 ] <html lang="en" class="no-js ie7">
/[if IE 8 ] <html lang="en" class="no-js ie8">
/[if IE 9 ] <html lang="en" class="no-js ie9">
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
%head
%meta{:charset => "utf-8"}/
/
Always force latest IE rendering engine (even in intranet) &amp; Chrome Frame
function loadCatalog () {
<%- @products.each do |product| -%>
storeProduct([0, <%= product.id %>, "", "<%= product.bon_name %>", "<%= product.article_number %>", <%= product.unit_price %>, <%= product.price %>, <%= product.slide? %>,0]);
<%- end -%>
<% @catalog.each do |catalog| -%>
<%- catalog.productgroups.slide.each do |productgroup| -%>
<%- unless productgroup.nil? %>
<%- productgroup.products.active.each do |product| -%>
<%- if product.slide? -%>
var Person = function(name) {
this.name = name;
};
Person.prototype.getName = function() {
return this.name
};
thomas.getName() // --> "Thomas"