Skip to content

Instantly share code, notes, and snippets.

@fakedarren
fakedarren / gist:3980110
Created October 30, 2012 13:13
Kill cookie snippet
$$('#cookiePolicy button[type=submit]').addEvent('click', function(evt){
evt.preventDefault();
new Cookie.write('THE_compliance', true, {
path: '/',
duration: 90
});
$$('#cookiePolicy').destroy();
});
/*----------------------------------------------------
Creates default 'My Pages' page texts.
- "My Account - Edit Bottom"
- "My Account - Edit Header"
- "My Comments - Empty"
- "My Comments - Header"
- "My Discussions - Empty"
@fakedarren
fakedarren / moofx.js
Created September 2, 2012 12:26
MooFx - to be used with other frameworks
(function(modules) {
var cache = {}, require = function(id) {
var module = cache[id];
if (!module) {
module = cache[id] = {
exports: {}
};
var exports = module.exports;
modules[id].call(exports, require, module, exports, window);
}
@fakedarren
fakedarren / jira-sucks.css
Created April 9, 2012 22:08
Make Jira less sucky
a { color: #325c99 !important; }
table.header { display: none !important; }
table.menu td {
background: #FFF !important;
height: 30px !important;
}
body > table > tbody > tr > td:nth-child(1) {
background: #fff !important;
}
body > table [bgcolor=f0f0f0] table[width="200"] > tbody > tr > td > table[width="100%"]:nth-child(1) {
@fakedarren
fakedarren / shockingly-bad-sproc.sql
Created September 4, 2011 09:50
An appallingly bad stored procedure I was given to 'work on' at work
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
--[CT_UGC_MyLibrary] 2,'',''
ALTER PROCEDURE [dbo].[CT_UGC_MyLibrary]
@subscribercode int,
Abacus.InitPopup = function(context){
if (Abacus.BeforeInitPopup){
Abacus.BeforeInitPopup(context);
}
context.getElements('form').addEvent('submit', function(evt){
if (!this.hasClass('no-ajax')) evt.stop();
});
context.getElements('button').addEvent('click', function(evt){
var parentform = $(this).getParent('form');
if (parentform){
@fakedarren
fakedarren / specs.txt
Created August 11, 2011 19:04
PC Specs
Intel Core 2 Quad 2.66 GHz Processor
Geforce FX9800GTX
4Gb DDR2 1066hz RAM
2x 500gb HDD
32x DVD writer
1x Sony 21" monitor (an awesome one)
Thermaltake Case with all the trimmings
Onboard LAN
It can run Crysis. Well.
@fakedarren
fakedarren / epic.sql
Created August 9, 2011 12:58
Epic XML SQL Query
DECLARE @MyXml XML
SET @MyXml = CAST('
<content>
<item>
<id>1</id>
<path>foo</path>
</item>
<item>
<id>2</id>
<!DOCTYPE html>
<?php
error_reporting(0);
require('libs/markdown.php');
require('libs/geshi/geshi.php');
require('libs/yaml.php');
require('libs/docs.php');
function wireUpEditableHeader() {
if ($('renewalcampaigneditableheader')) {
$('renewalcampaigneditableheader').addEvent('click', function (evt) {
evt.stop();
$("renewalcampaigneditableheader").addClass("hide");
$('renewaleditformcontainer').removeClass("hide");
});
}