Skip to content

Instantly share code, notes, and snippets.

View marek-saji's full-sized avatar
:shipit:

Marek ‘saji’ Augustynowicz marek-saji

:shipit:
View GitHub Profile
@marek-saji
marek-saji / jquery.outerhtml.js
Created July 19, 2011 11:10
jquery.outerhtml.js
(function ($) {
var nativeOuterHtml = ('outerHTML' in document.createElement('div'));
$.fn.outerHtml = function () {
if (nativeOuterHtml) {
return this[0].outerHTML;
}
else {
return this.eq(0).clone().appendTo($('<div />')).parent().html();
}
};
@marek-saji
marek-saji / dabblet.css
Created February 22, 2012 18:34
a good start
/**
* a good start
*/
@-ms-viewport { width: device-width; }
html
{
min-height : 100%;
font-family : sans-serif;
@marek-saji
marek-saji / dabblet.css
Created February 28, 2012 13:52
How to make <pre> grow with <code>?
/**
* How to make <pre> grow with <code>?
*/
html
{
background-color: #111;
}
article
@marek-saji
marek-saji / gvim.sh
Created March 2, 2012 14:15
re-use existing gvim window
#!/bin/sh
gvim=gvim
( pidof $( basename "$gvim" ) > /dev/null ) || exec "$gvim" "$1"
dn="$( pwd | sed 's/ /\\ /g' )"
fn="$( echo "$1" | sed 's/ /\\ /g' )"
exec "$gvim" --remote-send "<ESC>:cd ${dn}<CR>:tabnew +cd\ - ${fn}<CR>"
@marek-saji
marek-saji / 5.4.php
Created March 8, 2012 08:51
new stuff in php 5.4
<?php
/**
* `<?=` jest zawsze dostępny, niezależnie od ustawienia `short_open_tag`
*/
/**
* use newly created object on the fly
*/
$this->addFoo(
@marek-saji
marek-saji / index.html
Created March 15, 2012 23:03
ania's squirrel boy
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=1024" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>squirrel boy</title>
<meta name="description" content="" />
<?php
error_reporting(E_ALL | E_STRICT);
$foo = array('hello', ' ', 'world', '.');
$prefix = uniqid('♠');
extract($foo, EXTR_PREFIX_ALL|EXTR_REFS, $prefix);
$prefix .= '_';
for ($i = -1 ; isset(${$prefix . ++$i}) ;)
{
@marek-saji
marek-saji / dabblet.css
Created April 12, 2012 01:17
Responsive example with css-only mobile menu switch
/**
* Responsive example with css-only mobile menu switch
*/
html
{
font-family : sans-serif;
}
@marek-saji
marek-saji / dabblet.css
Created April 19, 2012 23:02 — forked from anonymous/dabblet.css
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
p
{
margin : 0;
}
section
{
@marek-saji
marek-saji / dabblet.css
Created April 21, 2012 21:16
Android 2.x does not animate css with position fixed?
/**
* Android 2.x does not animate css with position fixed?
*/
.a
{
border : #6f6 solid;
}
.b