Skip to content

Instantly share code, notes, and snippets.

View fightbulc's full-sized avatar
🍼
Family and buisness related projects. OS is on the low side atm

Tino Ehrich fightbulc

🍼
Family and buisness related projects. OS is on the low side atm
View GitHub Profile
@fightbulc
fightbulc / user-bet-stats.sql
Created December 23, 2011 09:53
User Bet Stats
SELECT
b.status,
count(b.id)
FROM
bets AS b
WHERE
708150929 IN (b.challenger_fbuser_id, opponent_fbuser_id)
GROUP by b.status
@fightbulc
fightbulc / gist:1445400
Created December 8, 2011 00:00
coffeescript array of implicit objects
[
foo: 0
bar: 1
,
baz: 2
]
[
{
foo: 0
@fightbulc
fightbulc / gist:1445394
Created December 7, 2011 23:59
coffeescript namespacing
# Code:
#
namespace = (target, name, block) ->
[target, name, block] = [(if typeof exports isnt 'undefined' then exports else window), arguments...] if arguments.length < 3
top = target
target = target[item] or= {} for item in name.split '.'
block target, top
# Usage:
#
@fightbulc
fightbulc / gist:1399974
Created November 28, 2011 10:56
Bootstrap Modal
<div id="browser-notification" class="modal hide fade">
<div class="modal-header">
<h3>Did you know? It's about time!</h3>
</div>
<div class="modal-body">
<p><strong>Beatguide only uses awesome features - to display them properly you need to switch to another browser.</strong> Choose one of the following. All free, easy to install and amazing:</p>
<p class="browser clearfix">
<a href="http://google.com/chrome"><img src="/assets/img/browser_chrome.png">Chrome</a>
<a href="http://www.mozilla.com/firefox"><img src="/assets/img/browser_firefox.png">Firefox</a>
<a href="http://www.apple.com/safari/download"><img src="/assets/img/browser_safari.png">Safari</a>
@fightbulc
fightbulc / gist:1373235
Created November 17, 2011 14:17
icanhaz updated with mustache 0.4.0-dev
/*!
ICanHaz.js version 0.9 -- by @HenrikJoreteg
More info at: http://icanhazjs.com
*/
(function($) {
/*
mustache.js — Logic-less templates in JavaScript
See http://mustache.github.com/ for more info.
*/
@fightbulc
fightbulc / contenteditable-post.php
Created November 16, 2011 15:45
Make contentEditable saveable (quick&dirty)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>contentEditable</title>
<style type="text/css">
div.wrapper
{
width:300px;
@fightbulc
fightbulc / gist:1360226
Created November 12, 2011 08:04
GA Asynchronous Tracking as needed for e.g. Single Page Apps
<!DOCTYPE html>
<head>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);
</script>
</head>