This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Jellybeans Colorscheme | |
~~~~~~~~~~~~~~~~~~~~~~ | |
Converted by Vim Colorscheme Converter | |
""" | |
from pygments.style import Style | |
from pygments.token import Token, Keyword, Number, Comment, Name, Operator, String, Generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Shuffle | |
Modified Fisher-Yates shuffle ( original from http://bost.ocks.org/mike/shuffle/ ) | |
to allow not shuffling specifically mapped array elements | |
Example: | |
var arry = [ 'aardvark', 'bison', 'cheeta', 'dingo', 'elephant', 'fawn', 'giraffe', 'hippo' ], | |
// don't shuffle 'bison' or 'elephant' | |
map = [ '', false, '', '', false ]; | |
shuffle( arry, map ); // ["fawn", "bison", "dingo", "giraffe", "elephant", "hippo", "cheeta", "aardvark"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* GitHub Pygments 11/8/2014 */ /* GitHub-Dark Solarized Dark theme http://git.io/9P8J1A */ /* http://pygments.org/_static/pygments.css */ | |
.syntax pre .hll { background-color: #ffffcc } | |
.highlight {background:#fff} .highlight, .highlight pre, .highlight table { background-color: #002b36 !important; color: #93a1a1 !important; } .syntax pre { background: #f0f0f0; } | |
.highlight .c, .highlight .c { color: #586e75 !important; } /* Comment */ .syntax pre .c { color: #60a0b0; font-style: italic } /* Comment */ | |
.highlight .cm, .highlight .cm { color: #586e75 !important; } /* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Returns URL parameter | |
* url: http://www.somesite.com?name=hello&id=11111 | |
* z = gup('name'); // z = hello; s = string, or leave blank to target window location | |
* Original code from Netlobo.com (http://www.netlobo.com/url_query_string_javascript.html) | |
*/ | |
function gup(n,s){ | |
n = n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"); | |
var p = (new RegExp("[\\?&]"+n+"=([^&#]*)")).exec(s || window.location.href); | |
return (p===null) ? "" : p[1]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Javascript function to convert rgb format to a hex color | |
* call : rgb2hex( "rgb(0, 70, 255)" ); | |
* returns: #0046ff | |
*/ | |
function rgb2hex(rgb){ | |
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); | |
return "#" + | |
("0" + parseInt(rgb[1],10).toString(16)).slice(-2) + | |
("0" + parseInt(rgb[2],10).toString(16)).slice(-2) + | |
("0" + parseInt(rgb[3],10).toString(16)).slice(-2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Return a unique array | |
* myArray = ["ccc","aaa","bbb","aaa"]; | |
* x = myArray.getUnique(); // x = ["ccc","aaa","bbb"] | |
* y = myArray.getUnique(true); // y = ["aaa","bbb","ccc"] | |
*/ | |
// Slightly faster version than getUnique2; Modified from | |
// http://dreaminginjavascript.wordpress.com/2008/08/22/eliminating-duplicates/ | |
Array.prototype.getUnique1 = function(s){ | |
var c, a = [], o = {}, i, j = 0, l = this.length; | |
for(i=0; i<l; ++i){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Find & return only duplicates from an Array | |
* also returned is an object with the # of duplicates found | |
* myArray = ["ccc", "aaa", "bbb", "aaa", "aaa", "aaa", "aaa", "bbb"]; | |
* x = myArray.getDuplicates(); | |
* // x = [ array of duplicates, associative object with # found] | |
* // x = [ ['aaa','bbb'] , { 'aaa' : 5, 'bbb' : 2 } ] | |
* alert(x[0]) // x[0] = ['aaa','bbb'] & alerts aaa,bbb | |
* alert(x[1]['aaa']) // alerts 5; | |
*/ | |
Array.prototype.getDuplicates = function(sort) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Enable or disable DOM objects | |
* This is a basic script - it won't determine | |
* if an object can be enabled or disabled | |
* | |
* Use: $('button').disable(); | |
* $('button').enable(); | |
*/ | |
(function($){ | |
$.fn.extend( { | |
enable : function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code I paste into the Firebug Console after I run the Visual Event | |
// bookmarklet (http://www.sprymedia.co.uk/article/Visual+Event) | |
// so I can cycle through the layers - Use arrow keys to cycle | |
var veColors = [ 'black', 'orange', 'purple', 'green', 'blue', 'yellow', 'red' ], | |
veColorLength= veColors.length - 1, | |
veLayerIndex = 0; | |
function showVeLayer(nxt){ | |
veLayerIndex += (nxt) ? 1 : -1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/************************************************ | |
Adding WordPress Quicktag Buttons to a WP Plugin | |
************************************************/ | |
?> | |
<style> | |
/* Simulate the input buttons styles */ | |
#ed_toolbar button { | |
display: inline-block; | |
vertical-align: middle; |
OlderNewer