Skip to content

Instantly share code, notes, and snippets.

Avatar
🥑
hi there!

Jannik apfelbox

🥑
hi there!
View GitHub Profile
@apfelbox
apfelbox / Article.md
Created Mar 11, 2015
Improved double ampersand mixin for Sass
View Article.md

The double ampersand -- or as A list apart called it "lobotomized owl selector" -- is a CSS rule that looks like the following:

* + * {
	/* some declarations */
}

You can also use it with a specific selector:

@apfelbox
apfelbox / gulpfile.js
Last active Feb 21, 2017
(gulp + browserify) - gulp-browserify
View gulpfile.js
var watch = require("gulp-watch");
var plumber = require("gulp-plumber");
var tap = require("gulp-tap");
var browserify = require("browserify");
var gulpif = require("gulp-if");
var streamify = require("gulp-streamify");
var gutil = require('gulp-util');
var isDebug = false;
@apfelbox
apfelbox / SassMeister-input.scss
Created Jun 25, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
@mixin fontface($fontname: "", $fontfile: "", $path: "", $weightnames: "", $weightnos: "", $fontvariant: "") {
$totalnofonts: length($weightnames);
@if ($totalnofonts > 0) {
$path: $path + $fontfile;
$i: 0;
@apfelbox
apfelbox / Parser.php
Last active Aug 12, 2016
Adjusted parser to render paragraphs which only contain a single image without the paragraph. So instead <p><img ...></p> it just renders<img ...>
View Parser.php
<?php
/**
* Adjusted parser to render paragraphs which only contain a single image without the paragraph.
*
* So instead
* <p><img ...></p>
*
* it just renders
* <img ...>
View facebook.scrollTop.js
// Function for returning the user to any 'y' position in a Facebook app/tab. Uses jQuery animate, otherwise gracefully falls-back without it.
// Source[1]: http://stackoverflow.com/questions/7193425/how-do-you-animate-fb-canvas-scrollto
// Source[2]: https://developers.facebook.com/docs/reference/javascript/FB.Canvas.scrollTo/
function scrollinFacebook (toY, duration) {
if (FB.Canvas.getPageInfo) {
FB.Canvas.getPageInfo (function (pageInfo) {
$({ y: pageInfo.scrollTop })
.animate({
y: toY
@apfelbox
apfelbox / SassMeister-input.scss
Created May 19, 2014
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
.foo {
@at-root {
@font-face {
font-family: "Ionicons";
src:url("../fonts/ionicons.eot?v=1.4.0");
@apfelbox
apfelbox / IE9.Win7.For.MacParallels.part01.sfx
Created Apr 9, 2014
Error messages when downloading the IE9 VM for OSX with Parallels from modern.ie - the direct links work.
View IE9.Win7.For.MacParallels.part01.sfx
<?xml version="1.0" encoding="utf-8"?><Error><Code>BlobNotFound</Code><Message>The specified blob does not exist.
RequestId:57420d5a-15a4-4784-bd28-256c7d5f82a5
Time:2014-04-09T07:39:59.3686754Z</Message></Error>
@apfelbox
apfelbox / Gruntfile.js
Created Apr 3, 2014
PoC for grunt sass for symfony config
View Gruntfile.js
module.exports = function(grunt) {
var path = require("path");
grunt.loadNpmTasks("grunt-contrib-sass");
grunt.initConfig({
sass: {
bundles: {
options: {
@apfelbox
apfelbox / _imp1.scss
Created Mar 20, 2014
Weird behaviour of `@extend` with `%` placeholder selectors.
View _imp1.scss
@import "inc";
.imp1 {
@extend %test;
}
@apfelbox
apfelbox / Gruntfile.js
Created Mar 19, 2014
Example code for `grunt-browserify` issue.
View Gruntfile.js
module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-browserify");
grunt.initConfig({
browserify: {
app: {
options: {
transform: ['browserify-shim']
},