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
#Just pure awesomeness! | |
bind '"\e[A"':history-search-backward | |
bind '"\e[B"':history-search-forward | |
bind Space:magic-space | |
# Misc ------------------------------------------------------------- | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# don't overwrite GNU Midnight Commander's setting of `ignorespace'. | |
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups:erasedups |
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 process | |
psf (){ ps auxwww | grep -i \[${1:0:1}\]${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
Here's how I edited it. | |
It should work, but I haven't really ran it through the browser. | |
Also, if you WANT it to work for IE5, you can include the 'map' function as shown in: | |
https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/Array/Map#Compatibility |
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
// If you want to flip a variable from true to false, you can do the following: | |
var x = false; | |
x = !!(~x+2); | |
// At this point, x is true. | |
// You can also do this with numbers. | |
// Let's say you want to flip 0 to 1 or 1 to 0. |
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
// If you want to flip a variable from true to false, you can do the following: | |
var x = false; | |
x = !!(x-1); | |
// At this point, x is true. | |
// Let's say you want to flip 0 to 1 or 1 to 0: | |
var y = 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
This requires CSS2.1 "counter" and ":before". As of now, every browser except IE supports it. | |
Actually, IE8 supports it, if and only if IE8 is set to render as IE8. | |
You can check out the compatibility chart PPK made at his site. | |
http://www.quirksmode.org/css/contents.html |
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
(?xi) | |
\b | |
( # Capture 1: entire matched URL | |
(?: | |
[a-z][\w-]+: # URL protocol and colon | |
(?: | |
/{1,3} # 1-3 slashes | |
| # or | |
[a-z0-9%] # Single letter or digit or '%' | |
# (Trying not to match e.g. "URI::Escape") |
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
// jQuery image magnifier; jdbartlett's rewrite of Chris Iufer's jLoupe | |
// $('<a href="bigimage.jpg"><img src="smallimg.jpg"></a>').loupe(); | |
// code: http://gist.github.com/252303 - demo: http://jsbin.com/olado3 | |
(function($) { | |
$.fn.loupe = function(options) { | |
if (!this.length) return this; | |
options = $.extend({ | |
loupe: 'loupe', | |
width: 200, | |
height: 150 |
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
The following Javascript finds the highest z-index in the page and changes the | |
background color to orange. | |
What I'm trying to do is find the DOM element with the highest z-index. I have | |
the following code, but I can't figure out how to do it without having the variable "high". | |
Can you figure out a better way? | |
Also, it doesn't seem to work in Safari. |
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
// I was bored. | |
// Sorry :( | |
function d(id){ return document.getElementById(id); } | |
window.onload = function(){ | |
var email_only = d('email_only'), | |
mail_only = d('mail_only'), | |
phone_only = d('phone_only'); | |
mail_only.style.display = phone_only.style.display = 'none'; | |
d('contact_us_stype_email').onclick = function () { |