Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
This file contains hidden or 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
| //EnhanceJS (enhancejs.googlecode.com) | |
| //Quick idea for loading CSS depending on Screen resolution with EnhanceJS. | |
| //Smart phones that pass capabilities tests would get mobile.css | |
| //enhance page based on capabilities and serve different CSS based on screen resolution | |
| enhance({ | |
| loadStyles: screen.availWidth < 500 ? ['css/mobile.css'] : ['css/screen.css'] | |
| }); |
This file contains hidden or 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 (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
| var Storage = function (type) { | |
| function createCookie(name, value, days) { | |
| var date, expires; | |
| if (days) { | |
| date = new Date(); | |
| date.setTime(date.getTime()+(days*24*60*60*1000)); | |
| expires = "; expires="+date.toGMTString(); |
This file contains hidden or 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 (select(2, UnitClass("player")) ~= "PRIEST") then | |
| return | |
| end | |
| local _, bindings = ... | |
| local priestBase = { | |
| [1] = "s|Holy Fire", | |
| [2] = "s|Smite", | |
| [3] = "s|Mind Blast", |
This file contains hidden or 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
| //EnhanceJS isIE test idea | |
| //detect IE and version number through injected conditional comments (no UA detect, no need for cond. compilation / jscript check) | |
| //version arg is for IE version (optional) | |
| //comparison arg supports 'lte', 'gte', etc (optional) | |
| function isIE(version, comparison) { | |
| var cc = 'IE'; | |
| if(version){ |
This file contains hidden or 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
| /* coordinate-based click event | |
| - jsbin http://jsbin.com/ivaxu3/edit | |
| */ | |
| $.fn.clickxy = function(xy, callback){ | |
| var inzone = false, | |
| tolerance = 10; | |
| return $(this) | |
| .bind('mousemove',function(e){ | |
| var offset = $(this).offset(), |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using Mono.Cecil; | |
| using Mono.Cecil.Cil; | |
| class MethodProcessor { | |
| readonly MethodBody body; |
This file contains hidden or 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
| module PixenToGameQuery | |
| require 'RMagick' | |
| include Magick | |
| FPR = 12 # Frames per row in a sprite sheet generated by Pixen | |
| COLPAD = 2 # Pix between each column of images on the sprite sheet | |
| ROWPAD = 2 # Pix between each row of images on the sprite sheet | |
| LEFTPAD = 4 # Extra pix on left of sprite sheet | |
| RIGHTPAD = 20 # Extra pix on right of sprite sheet | |
| BOTTOMPAD = 2 # Extra pix on bottom of sprite sheet |
This file contains hidden or 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
| window.onorientationchange = function() { | |
| if (window.orientation == 0) { | |
| $('#sidebar').fadeOut() | |
| } else { | |
| $('#sidebar').fadeIn() | |
| } | |
| } |
This file contains hidden or 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 TextChange Plugin | |
| * http://www.zurb.com/playground/jquery-text-change-custom-event | |
| * | |
| * Copyright 2010, ZURB | |
| * Released under the MIT License | |
| */ | |
| (function ($) { | |
| $.event.special.textchange = { |