Skip to content

Instantly share code, notes, and snippets.

View rocktronica's full-sized avatar
😎
sup

Tommy rocktronica

😎
sup
View GitHub Profile
@rocktronica
rocktronica / gist:1592913
Created January 11, 2012 03:49
onefilecms 1.1.3
<?php /*
OneFileCMS - http://onefilecms.com/
an iamnotagoodartist project - http://iamnotagoodartist.com/
Protected by a Creative Commons "Attribution Non-Commercial Share Alike" License.
http://creativecommons.org/licenses/by-nc-sa/3.0
Free for personal or non-commercial websites. To receive an exception to use this software commercially, please consider purchasing a $20 commercial license.
http://onefilecms.com/license.php
@rocktronica
rocktronica / rotwang
Created January 27, 2012 05:14
JS function timer function, tinker
var rotwang = (function ($, undefined) {
this.timers = {};
this.addTime = function (sTime, iTime) {
this.timers[sTime] = this.timers[sTime] || [];
this.timers[sTime].push(iTime);
};
this.averages = (function () {
$.each(this.timers, function (key, times) {
var iTotal = 0, iCount = 0;
$.each(times, function (i, time) {
@rocktronica
rocktronica / gist:1696006
Created January 28, 2012 22:26
Scraping PMs off the SETV forums
if (!$) { throw "Please jQuerify."; }
var iStart = 180, sName = "Case-Sensitive Name";
var w = window.open();
var $output = $(w.document).find("body").css({
"width": "600px",
"margin": "20px auto",
"font-family": "Sans-Serif"
});
@rocktronica
rocktronica / gist:1700623
Created January 29, 2012 21:01
An Auto-Updating Data URI Text Editor
data:text/html,
<body id='b'>
<textarea spellcheck="false" id="t"></textarea>
<script>
var f,
t = document.getElementById("t"),
@rocktronica
rocktronica / data.json
Created March 6, 2012 22:44
newsletter - tmpltr
{
"Title": "BubbleLife",
"Subtitle": "Park Cities BubbleLife Edition (BETA)",
"Topics": [
{
"Title": "News",
"CssClass": "bigguy",
"Items": [
{
var results = { heads: 0, tails: 0, total: 0 };
function coinflip() {
var heads = !!Math.round(Math.random());
if (heads) {
results.heads++;
} else {
results.tails++;
};
results.total++;
@rocktronica
rocktronica / gist:2025024
Created March 12, 2012 22:11
fixed header w/ whitespace
body { background: #fff; }
.dxmDomainTopGroup { position: fixed; z-index: 1; opacity: .8; }
.tdRight { padding: 0 20px; box-shadow: none; }
.MainFrame, .MainFrameTabs { -webkit-box-shadow: none; box-shadow: none; border: none; border-radius: 0; }
.tdLeft { background: #fff; border: none; }
.tdLeft .widget { background: #eef2f4 url("/App_Themes/BubbleBase/images/100-90-4-monochrome.png"); border: 1px solid #ccc; margin: 0 0 20px; border-radius: 2px; }
@rocktronica
rocktronica / iclicks.html
Created March 22, 2012 05:18
iClicks++
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>iClicks++</title>
</head>
<style>
*{padding:0;margin:0;font-size:inherit;}
body {
@rocktronica
rocktronica / gist:2175583
Created March 23, 2012 22:14
Lorem function w/ input and tinyMCE filler
function lorem(iWords, bPunct) {
var s = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
words = s.toLowerCase().replace(/[^a-zA-Z 0-9]+/g,'').split(/\s/),
iWords = iWords || 5,
sOutput = "";
for (var i = 0; i < iWords; i++) {
sOutput += " " + words[Math.ceil(Math.random() * words.length) - 1];
if (bPunct && i < iWords - 1) {
if (!Math.round(Math.random() * 15)) {
sOutput += ".";
@rocktronica
rocktronica / netflix.css
Created March 25, 2012 22:58
Cleaner Netflix CSS
#SLPlayer {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 100% !important;
height: 100% !important;
}
body {