Skip to content

Instantly share code, notes, and snippets.

View fearphage's full-sized avatar
⌨️
Cache rules everything around me.

Phred Lane fearphage

⌨️
Cache rules everything around me.
View GitHub Profile
@fearphage
fearphage / chromium12.htm
Created March 29, 2011 16:00
Comparing the same page in 2 different browsers (server side sniffing is evil)
<!DOCTYPE html>
<html>
<head>
@fearphage
fearphage / xml2json.js
Created April 6, 2011 16:43
Changes XML to JSON
// Changes XML to JSON
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) { // element
// do attributes
if (xml.attributes.length > 0) {
obj["@attributes"] = {};
@fearphage
fearphage / diff.js
Created May 11, 2011 22:41 — forked from ucnv/diff.js
// http://ido.nu/kuma/2007/10/01/diff-onp-javascript-implementation/
/*
Copyright (c) 2007, KUMAGAI Kentaro
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of this project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
@fearphage
fearphage / README
Created May 12, 2011 17:20
"VERIFY MY ACCOUNT" facebook worm source
Original source of self-propagating Facebook worm
Original location: http://pelorak.info/verify.js
@fearphage
fearphage / gist:973303
Created May 15, 2011 16:56
Another facebook worm
We couldn’t find that file to show.
@fearphage
fearphage / opera-next.desktop
Created May 23, 2011 13:22
Unity file for Opera
[Desktop Entry]
Type=Application
Version=1.0
Name=Opera Next
GenericName=Web browser
GenericName[bs]=Web preglednik
GenericName[de]=Web-Browser
GenericName[eo]=TTT-rigardilo
GenericName[es]=Navegador web
GenericName[et]=Veebibrauser
#!/usr/bin/python
########################################################
# Unity Opera
#
# Author: Kyle Baker (kyleabaker.com)
# Description: Provides several features for Unity users
# who also use Opera or Opera Next that are
# not available by default.
# Version: 2011-05-07
# Help: python unity-opera.py --help
" turn off word wrapping
set wrap!
set relativenumber
"Turn on smart indent
set smartindent
set tabstop=2 " set tab character to 4 characters
set expandtab " turn tabs into whitespace
set shiftwidth=2 " indent width for autoindent
filetype indent on " indent depends on filetype
var UserProfile = Backbone.Model.extend({
url: '/user'
});
var UserProfileView = Backbone.View.extend({
initialize: function() {
_.bindAll(this, 'render');
}
,render: function() {
console.log(this.model, this.model.attributes, this.model.attributes.username, this.model.get('username'));
filetype plugin indent on
set expandtab
set smartindent
set relativenumber
set textwidth=79
set colorcolumn=81
set nofoldenable
set hlsearch
set incsearch