⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
/*! | |
An experiment in getting accurate visible viewport dimensions across devices | |
(c) 2012 Scott Jehl. | |
MIT/GPLv2 Licence | |
*/ | |
function viewportSize(){ | |
var test = document.createElement( "div" ); | |
test.style.cssText = "position: fixed;top: 0;left: 0;bottom: 0;right: 0;"; |
// Add a getElementsByClassName function if the browser doesn't have one | |
// Limitation: only works with one class name | |
// Copyright: Eike Send http://eike.se/nd | |
// License: MIT License | |
if (!document.getElementsByClassName) { | |
document.getElementsByClassName = function(search) { | |
var d = document, elements, pattern, i, results = []; | |
if (d.querySelectorAll) { // IE8 | |
return d.querySelectorAll("." + search); |
<!DOCTYPE html> | |
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Breakpoint detection test</title> | |
<style type="text/css" media="screen"> | |
@media screen and (min-width: 320px) { | |
#page:after { | |
content: 'smallest'; /* represent the current width-bracket */ |
#!/usr/bin/env ruby -w | |
# pnginator.rb: pack a .js file into a PNG image with an HTML payload; | |
# when saved with an .html extension and opened in a browser, the HTML extracts and executes | |
# the javascript. | |
# Usage: ruby pnginator.rb input.js output.png.html | |
# By Gasman <http://matt.west.co.tt/> | |
# from an original idea by Daeken: http://daeken.com/superpacking-js-demos |
// Add a Modernizr check for VML | |
Modernizr.addTest('vml', function() { | |
// Adapted from http://stackoverflow.com/questions/654112/how-do-you-detect-support-for-vml-or-svg-in-a-browser | |
var a = document.body.appendChild(document.createElement('div')); | |
a.innerHTML = '<v:shape id="vml_flag1" adj="1" />'; | |
var b = a.firstChild; | |
b.style.behavior = "url(#default#VML)"; | |
var supportsVml = b ? typeof b.adj == "object": true; | |
a.parentNode.removeChild(a); | |
return supportsVml; |
//! from http://www.quirksmode.org/js/cookies.html | |
function createCookie(name,value,days) { | |
if (days) { | |
var date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
var expires = "; expires="+date.toGMTString(); | |
} | |
else var expires = ""; | |
document.cookie = name+"="+value+expires+"; path=/"; |
/* | |
Dropshadow handling in IE vs. native box-shadow support | |
- Normal box-shadow on .dropshadow | |
///////////////////// | |
/ +===============+ / | |
/ | | / | |
/ | | / | |
/ | | / |
This is my wiki. There are many like it, but this one is mine.
My wiki is my best friend. It is my life. I must master it as I must master my life.
My wiki, without me, is useless. Without my wiki, I am useless. I must wiki true. I must wiki better than my enemy who is trying to out wiki me. I must wiki him before he wikis me. I will...
My wiki and myself know that what counts in this war is not the docs we type, the users who read, or the communities we forge. We know that it is the wikis that count. We will hit...
My wiki is human, even as I, because it is my life. Thus, I will learn it as a brother. I will learn its weaknesses, its strength, its parts, its accessories, its widgets and its syntax. I will keep my wiki clean and ready, even as I am clean and ready. We will become part of each other. We will...