Skip to content

Instantly share code, notes, and snippets.

View mgussekloo's full-sized avatar

Martijn Gussekloo mgussekloo

View GitHub Profile
// myapp.js
$(function() {
var tabs=function(id) {
$(".tab").removeClass("active").filter(".tab[href*='" + id + "']").addClass("active");
$(".tabview").hide().filter("#" + id).show();
}
window.realDate=function(timestamp) {
var date = new Date(timestamp*1000);
@mgussekloo
mgussekloo / gist:8504345
Created January 19, 2014 12:39
Sublime Text build script: Löve game engine
{
"cmd": ["/usr/bin/killall love ; /Applications/love.app/Contents/MacOS/love ${project_path}"],
"working_dir": "${project_path}",
"shell": true
}
@mgussekloo
mgussekloo / gist:8504708
Created January 19, 2014 13:04
Simple animation class for Löve using HUMP
Animation = Class {
init = function(self, image, pos, steps, frameDelay)
self.image = image
self.pos = pos
self.width = image:getWidth()
self.height = image:getHeight()
self.frames = {}
self.currentFrameNumber = 0
<iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Sumatralaan+45,+Hilversum,+The+Netherlands&amp;aq=0&amp;oq=sumatralaan+45,+hilversum&amp;sll=52.236624,5.172801&amp;sspn=0.00636,0.012563&amp;t=m&amp;ie=UTF8&amp;hq=&amp;hnear=Sumatralaan+45,+1217+GP+Hilversum,+Noord-Holland,+The+Netherlands&amp;ll=52.237104,5.173359&amp;spn=0.018397,0.036478&amp;z=14&amp;iwloc=near&amp;output=embed"></iframe>
<p><a href="https://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=Sumatralaan+45,+Hilversum,+The+Netherlands&amp;aq=0&amp;oq=sumatralaan+45,+hilversum&amp;sll=52.236624,5.172801&amp;sspn=0.00636,0.012563&amp;t=m&amp;ie=UTF8&amp;hq=&amp;hnear=Sumatralaan+45,+1217+GP+Hilversum,+Noord-Holland,+The+Netherlands&amp;ll=52.237104,5.173359&amp;spn=0.018397,0.036478&amp;z=14">Bekijk grotere kaart</a></p>
local Class = require "hump.class"
local AStar = require "Marsgus.astar"
local Marsgus = {}
Marsgus.Tilemap = Class {
init = function(self, image)
self.tilesetBatch = love.graphics.newSpriteBatch(image, gameSettings.resolution.width / (gameSettings.tileWidth * gameSettings.zoom) * gameSettings.resolution.height / (gameSettings.tileHeight * gameSettings.zoom))
self.quads = {}
<h4(.*?)>|</h4>|<h2(.*?)>|</h2>|<h3>|</h3>|<p(.*?)>|</p>|<span(.*?)>|</span>|_{2,}|&nbsp;|class="(.*?)"|height="(.*?)"|width="(.*?)"|alt=""|target="(.*?)"|style="(.*?")|<div(.*?)>|</div>|<table(.*?)>|</table>|<tr>|</tr>|<td(.*?)>|</td(.*?)>|<tbody>|</tbody>|http://www\.cmhf\.nl
@mgussekloo
mgussekloo / gist:9077f382beac43cfe622
Last active August 29, 2015 14:04
Using simple bash script to compile js and css (without Grunt)
#!/bin/bash
Curpath="`pwd`"
WatchEnabled=false
SassEnabled=false
JsEnabled=false
VersionEnabled=false
while [ $# -gt 0 ]
do
$(function(){
var documentHeight,
windowHeight,
creativeShipping,
creativeShippingBottom;
// Do not use $(document).height();, chrome returns wrong value
//documentHeight = $(document).height();
@mgussekloo
mgussekloo / gist:8ec5fa53c1505d032991
Last active January 26, 2018 00:09
Timberdate-filter for Twig, to use in combination with Wordpress & Timber
Add to something like functions.php
// https://www.skyverge.com/blog/down-the-rabbit-hole-wordpress-and-timezones/
function wp_get_timezone_string() {
// if site timezone string exists, return it
if ( $timezone = get_option( 'timezone_string' ) )
return $timezone;
// get UTC offset, if it isn't set then return UTC
@mgussekloo
mgussekloo / gist:7eb4233d15063a8e27ad
Created November 17, 2015 08:32
Updating EXIF timestamps of photos and avi's, for use with Dropbox Carousel timeline
This should be a part of the Carousel app, but whatever. You'll need ExifTool and FFMPEG.
exiftool -all= -tagsfromfile @ -all:all -unsafe -icc_profile -overwrite_original .
exiftool -if 'not $datetimeoriginal' '-DateTimeOriginal=1980:01:01 00:00:00' -overwrite_original .
ffmpeg -i "input.avi" -metadata "ICRD=1980:01:01 00:00:00" -codec copy "output.avi"