Skip to content

Instantly share code, notes, and snippets.

View dbergey's full-sized avatar
🙃

Diana Bergey dbergey

🙃
View GitHub Profile
<?php
function a() {
echo "Called A.\n";
return false;
}
function b() {
echo "Called B.\n";
return true;
@dbergey
dbergey / gist:464024
Created July 5, 2010 05:01
Demonstrates Safari 5 compositing bug
<style>
body { font: 13px arial; }
p { position: relative; }
p.fixed { background: white; }
object {
float: left;
border: 1px solid red;
margin: 0 10px 10px 0;
width: 200px;
height: 50px;
// Here is how to get less parsing of <style> tags for quick development
// I made this with less.js 1.0.17, not sure how far back it works
// change this to wherever your less.js is stored
<script src="http://dkb.local/js/lessjs/less.js"></script>
// then do this somewhere
<script>
var styleEls = document.getElementsByTagName('style');
for (var i in styleEls)
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script>
$.extend($.expr[':'], {
childless: function(a) {
return !$(a).children().not('a').size();
}
});
$(function() {
console.log($('.value:childless').get());
// checks every few secs to see if any source file is updated and reloads if needed
// reloadr.php should check mtimes of files you want to track and return max(mtimes).
// like this:
/*
<?php
$files = array_merge(
glob('*.php'),
glob('tests/*.php')
);
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
// jquery error checking plugin
(function($) {
errors = {
test: function() {
var args = $.makeArray(arguments);
var msg, test = args.shift();
if ( msg = errors.tests[test].apply(this, args) ) throw msg;
},