Skip to content

Instantly share code, notes, and snippets.

@cyberstream
cyberstream / LICENSE.txt
Created February 10, 2012 06:02 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Eli Mitchell <http://www.cyberstream.us>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@cyberstream
cyberstream / LICENSE.txt
Created February 10, 2012 06:01 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@cyberstream
cyberstream / create_ratings_table.sql
Created February 8, 2012 05:50
The SQL code for creating the ratings table for the "Fix the Web" server-side project
CREATE TABLE IF NOT EXISTS `ratings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_foreign_key` int(11) NOT NULL COMMENT 'links this row to the report or comment in the reports table',
`username` varchar(128) NOT NULL,
`is_read` tinyint(1) NOT NULL COMMENT '0 => not read, 1 => is read',
`rating` tinyint(1) NOT NULL COMMENT '-1 => rate comment down; 0 => this is a subscription, not a rating; 1 => rate comment up',
PRIMARY KEY (`id`),
KEY `id_foreign_key` (`id_foreign_key`,`is_read`),
KEY `rating` (`rating`)
) ENGINE=InnoDB;
@cyberstream
cyberstream / create_reports_table.sql
Created February 8, 2012 05:49
The SQL code for creating the reports table for the "Fix the Web" server-side project
CREATE TABLE IF NOT EXISTS `reports` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`report_id` int(11) DEFAULT NULL COMMENT 'If this is a comment, then this field should be the id of the report the comment is for',
`username` varchar(128) NOT NULL COMMENT 'The user''s Opera username',
`language` char(2) DEFAULT NULL COMMENT 'Two-character abbreviation for the language of this comment',
`category` tinyint(1) DEFAULT NULL COMMENT '1 => minor annoyance; 2 => major problem; 3 => site unusable',
`report` text NOT NULL COMMENT 'The content of the report or comment',
`page` varchar(510) DEFAULT NULL COMMENT 'The full URL of the page the error was reported about. NULL in comments',
`domain` varchar(255) DEFAULT NULL COMMENT 'The domain name of the site which the error report was submitted from; NULL in comments',
`opera_version` varchar(10) NOT NULL COMMENT 'opera.version()',
@cyberstream
cyberstream / Array.prototype.insert
Created August 17, 2011 02:42
Insert an item into an array at the given zero-based offset, positive or negative
function(i,o){r=this;o=(o==-1?r.length:(o<-1?o+1:o));return r.slice(0,o).concat(i).concat(r.slice(o,r.length))}