Skip to content

Instantly share code, notes, and snippets.

View pbroschwitz's full-sized avatar

Peter Broschwitz pbroschwitz

View GitHub Profile
@pbroschwitz
pbroschwitz / addFbAppToTab.html
Created March 27, 2012 09:43
Facebook Application to Tab
<html>
<head>
<title>Add Facebook Application to Tab</title>
</head>
<body>
<form action="https://www.facebook.com/dialog/pagetab" method="get">
<p>Fill your application details and press Submit, a dialog will appear to choose which page to add the app to.</p>
<label for="app_id" title="You can find your APP_ID at https://developers.facebook.com/apps/">App ID</label>
<input id="app_id" name="app_id" size="18" type="text" />
/* scss */
#nav {
li a {
color: maroon;
body.admin & { border-bottom: dotted 1px maroon; } // <-- Awesome-sauce right there
&:hover {
color: purple;
}
@pbroschwitz
pbroschwitz / dabblet.css
Created April 17, 2012 20:26 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@pbroschwitz
pbroschwitz / dabblet.css
Created April 18, 2012 12:34 — forked from anonymous/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.teaser {
overflow: hidden;
height: 250px;
display: inline-block;
position: relative;
outline:0 none}
@pbroschwitz
pbroschwitz / dabblet.css
Created May 6, 2012 17:44 — forked from LeaVerou/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@pbroschwitz
pbroschwitz / clean-caches.sh
Created June 13, 2012 08:43
Clean cache directories
#!/usr/bin/env bash
#SCRIPT_PATH="$(readlink -f $0)"
#SCRIPT_DIR="$(dirname ${SCRIPT_PATH})"
SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd)"
function deleteIfExisting {
local dirToDel="${SCRIPT_DIR}/${1}"
if [[ -w "${dirToDel}" ]] ; then
echo "Deleting '${dirToDel}' ..."
@pbroschwitz
pbroschwitz / sprite.scss
Created June 15, 2012 12:52
Sass sprite mixin
@mixin sprite($width, $height, $x, $y, $asset : "../img/assets.png") {
width:$width;
height:$height;
background-image:url($asset);
background-position:$x $y;
background-repeat:no-repeat;
color:transparent !important;
text-indent:-999em;
padding:0;
display:inline-block;
@pbroschwitz
pbroschwitz / get-current-page-url.php
Created June 18, 2012 23:18
Get current page url
// @see http://css-tricks.com/snippets/php/get-current-page-url/?utm_source=dlvr.it&utm_medium=twitter
function getUrl() {
$url = @( $_SERVER["HTTPS"] != 'on' ) ? 'http://'.$_SERVER["SERVER_NAME"] : 'https://'.$_SERVER["SERVER_NAME"];
$url .= ( $_SERVER["SERVER_PORT"] !== 80 ) ? ":".$_SERVER["SERVER_PORT"] : "";
$url .= $_SERVER["REQUEST_URI"];
return $url;
}
@pbroschwitz
pbroschwitz / es6.js
Created June 21, 2012 16:08 — forked from paulrouget/es6.js
Some ECMAScript 6 element are available in Firefox
// To test this code in Firefox, I encourage you to use Firefox Aurora
// and to include your script this way:
// <script type="application/javascript;version=1.8">
/* let ********************************************* */
// let is the new var :)
// Declares a block scope local variable
var a = 5;
@pbroschwitz
pbroschwitz / dabblet.css
Created June 25, 2012 08:48 — forked from LeaVerou/dabblet.css
CSS Box model demo
/**
* CSS Box model demo
*/
#box {
width: 300px;
height: 200px;
padding: 20px;
border-width: 15px;
box-sizing: border-box;