Skip to content

Instantly share code, notes, and snippets.

@sjockers
sjockers / gist:1206456
Created September 9, 2011 15:01
IE6/7 workaround for jQuery's slideUp() and slideDown() methods
// slideUp() and slideDown() are terribly buggy in IE6 and IE7. Try using this instead:
.animate({ height: "toggle", opacity: "toggle"}, 600 );
@sjockers
sjockers / window.log
Created September 15, 2011 07:53
Simple wrapper for console.log
// usage: log('inside coolFunc',this,arguments);
// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};
@sjockers
sjockers / index.html
Created October 14, 2011 22:06 — forked from mbostock/.block
Google Maps + D3
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<style type="text/css">
html, body, #map {
width: 100%;
@sjockers
sjockers / layout.sass
Created March 1, 2012 08:01 — forked from jcroft/layout.sass
How easy responsive design can be with Sass
#content-wrapper
+container
#about
// Default (smallest screens)
+column(100%)
background-color: #ccc
// Respond to other screen widths
@sjockers
sjockers / gist:4020821
Created November 5, 2012 22:27
HTML5 BUG#2 talk notes: So you want to get into web development?
@sjockers
sjockers / gist:4170211
Last active October 13, 2015 08:48
AWE: UIDsgn

Last minute update: We are organizing a hackday! Add your name to the list if you'd like to join us: http://doodle.com/i4g5y6fpcpktrmcr


Description and schedule for the master's seminar "Current trends in web-standards based UI-design" at HTW Berlin

Recent years have seen significant change in the way users engage with the web. With the rapid progress of web standards and browser technology, it has evolved from a platform for hypertext content to an universal runtime environment for applications. Also, the context in which people use the web has changed. The near-ubiquitous availability of internet access has moved the web from the desk to our pockets — to smartphones, tablets and other mobile devices.

Goals and Objectives

class GoogleAnalytics
@init: (webPropertyId) ->
@_initQueue webPropertyId
scriptTag = @_createScriptTag()
@_injectScriptTag scriptTag
true
@_initQueue: (webPropertyId) ->
window._gaq ?= []
window._gaq.push ['_setAccount', webPropertyId]
@sjockers
sjockers / gist:58c7e67bbb75bb664371
Last active December 15, 2016 11:53
Critical Mass Berlin, March 2015
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sjockers
sjockers / claimReview.html
Last active November 14, 2016 15:42
Claim review meta data on correctiv.org, JSON-LD example
<!-- http://pending.schema.org/ClaimReview -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": ["Review", "ClaimReview"],
"datePublished": "2016-08-17T13:06:00+01:00",
"url": "https://correctiv.org/blog/ruhr/artikel/2016/08/17/debatte-um-beschaeftigtenzahlen-ruhrgebiet/",
"author": {
"@type": "Organization",
@sjockers
sjockers / wikipedia-constituencies-scraper.js
Last active April 17, 2018 10:42
Scrape the 2013 Bundestag election results for individual constituencies from Wikipedia using artoo.js
// Scrape the 2013 Bundestag election results for individual constituencies from Wikipedia
// - using artoo.js v0.3.3.1 (http://medialab.github.io/artoo/)
// - starting point: https://de.wikipedia.org/wiki/Liste_der_Bundestagswahlkreise_2013
var result = []
var baseUrl = 'https://de.wikipedia.org'
var pages = artoo.scrape('.wikitable:nth-of-type(2) td:nth-of-type(2) a,\
.wikitable:nth-of-type(2) td:nth-of-type(6) a', function() {
return baseUrl + $(this).attr('href')
})