Skip to content

Instantly share code, notes, and snippets.

View andi1984's full-sized avatar
🏠
Working from home

Andreas Sander andi1984

🏠
Working from home
View GitHub Profile
//run this script after jQuery loads, but before jQuery Mobile loads
//customize jQuery Mobile to let IE7+ in (Mobile IE)
$(document).bind("mobileinit", function(){
$.extend( $.mobile , {
//extend gradeA qualifier to include IE7+
gradeA: function(){
//IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683
var ie = (function() {
@anselmh
anselmh / resimg-syntax-test.html
Last active December 25, 2015 20:49
It's a quick demo of the three candidates of #respimg syntax. I simply want to compare verbosity of all those.
<!--
A quick demo of the three current candidates of Responsive Images syntax on a real world example for one image.
This on purpose does not include any of the proposed viewport syntaxes because this IMO adds confucion and
is stylistic only (therefore should go in CSS IMO).
-->
<!-- This is the src-{N} way: http://tabatkins.github.io/specs/respimg/Overview.html -->
@blackfalcon
blackfalcon / SassMeister-input.scss
Last active December 30, 2015 07:39
Sass 3.3 at-root feature
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
@media print {
.page {
width: 8in;
@at-root (without: media) {
color: red;
@marczobec
marczobec / vine.php
Last active April 24, 2016 16:27
Extension for Kirby's kirbytext. Embed vine posts in your content with a tag. For more information about Kirby visit http://getkirby.com
<?php
kirbytext::$tags['vine'] = array(
'attr' => array(
'size'
),
'html' => function($tag) {
$vineURL = $tag->attr('vine');
$size = $tag->attr('size', '300');

CoderDojo Berlin

CoderDojo ist ein Club für Kinder und Jugendliche im Alter von 5 bis 17 Jahren, die programmieren lernen und Spaß haben wollen. Freiwillige Mentor_innen helfen den Kindern, ihre Ideen umzusetzen. Dabei lernen sie spielerisch die Grundlagen des Programmierens. Und auch wenn sie die Grundlagen schon kennen, gibt es noch mehr als genug neue Konzepte zu lernen.

Wann / Wo

Wir treffen uns einmal im Monat, jedesmal woanders. Den nächsten Termin und Ort findest du immer hier: http://bit.ly/coderdojoberlin

Ablauf

@mhuneke
mhuneke / ngTap.js
Created November 6, 2012 18:02
Angular ng-tap directive
(function(angular) {
'use strict';
var directives = angular.module('app.directives', []);
directives.directive('ngTap', function() {
return function(scope, element, attrs) {
var tapping;
tapping = false;
element.bind('touchstart', function(e) {
@Shoom
Shoom / gist:9622e6e09ca6be63f98f
Last active July 19, 2018 11:52
CSSconf EU 2014
{
"cssconf": {
"location": {
"date": "September 12, 2014",
"country": "Germany",
"city": "Berlin",
"venue": "Radialsystem V",
"lat": 52.51039,
"long": 13.42864
},

Parens And Performance

Years ago, some smart folks that worked on JS engines realized that not all JS that's loaded into a page/app initially is needed right away. They implemented JIT to optimize this situation.

JIT means Just-In-Time, which means essentially that the engine can defer processing (parsing, compiling) certain parts of a JS program until a later time, for example when the function in question is actually needed. This deferral means the engine is freer to spend the important cycles right now on the code that's going to run right now. This is a really good thing for JS performance.

Some time later, some JS engine devs realized that they needed to get some hints from the code as to which functions would run right away, and which ones wouldn't. In technical speak, these hints are called heuristics.

So they realized that one very common pattern for knowing that a function was going to run right away is if the first character before the function keyword was a (, because that usually m

@StevenLangbroek
StevenLangbroek / recs.md
Last active December 3, 2019 17:51
Berlin Recommendations for ReactDay 2019 Attendees

So, you think you can Berlin?

You can! You don't need my help, but here's some places I love love love in Berlin. I'll try to focus on the area around the venue, but travelling within the inner ring of Berlin is easy, fast and safe (if you disagree please let me know, let's talk and revise with some specific recommendations).

Food (these all have veggie & vegan options unless otherwise indicated)

@jasonwyatt
jasonwyatt / MySingleton.js
Created July 26, 2011 15:09
Singleton Pattern with Require JS
define(function(){
var instance = null;
function MySingleton(){
if(instance !== null){
throw new Error("Cannot instantiate more than one MySingleton, use MySingleton.getInstance()");
}
this.initialize();
}