Skip to content

Instantly share code, notes, and snippets.

@bondarewicz
bondarewicz / gist:4150242
Created November 26, 2012 19:53
Lorem.io Instance
$('#element').lorem({
length: 'one'
});
@bondarewicz
bondarewicz / gist:4150250
Created November 26, 2012 19:56
Lorem.io Metadata
<div data-lorem='{"length":"two"}'></div>
@bondarewicz
bondarewicz / gist:4150255
Created November 26, 2012 19:57
Lorem.io Default
$('#element').Lorem();
$('#element').Lorem({"length" : "one"});
$('.class').Lorem({"length" : "two"});
$('#element').Lorem({"length" : "three"});
$('#element').Lorem({"length" : "full"});
@bondarewicz
bondarewicz / gist:4150333
Created November 26, 2012 20:14
Lorem.io Source
<script src="http://code.jquery.com/jquery-1.7.min.js"></script>
<script src="http://lorem.io/jquery.lorem.min.js" type="text/javascript"></script>
@bondarewicz
bondarewicz / gist:4605507
Last active December 11, 2015 13:08
PHP: Deep Convert object to array
//object to array deep conversion
function object2array( $o )
{
$a = (array) $o;
foreach( $a as &$v )
{
if( is_object( $v ) )
{
$v = object2array( $v );
@bondarewicz
bondarewicz / js greeting
Created February 19, 2013 12:21
JS: Greeting
<!--
// Array of day names
var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday");
var now = new Date();
document.write("Happy " + dayNames[now.getDay()] + ".");
// -->
@bondarewicz
bondarewicz / gist:5143150
Last active December 14, 2015 20:19
PHP: Generate random upper/lower case
<?php
$s = 'mynotsoverylongstring';
print randomcase($s);
function randomcase($string='') {
$length = strlen($string);
$chars = $string;
$str = "";
@bondarewicz
bondarewicz / gist:5170085
Created March 15, 2013 14:04
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@bondarewicz
bondarewicz / gist:5171664
Last active December 15, 2015 00:19 — forked from padolsey/gist:527683
JS: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->