# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
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
// Disable scroll zooming and bind back the click event | |
var onMapMouseleaveHandler = function (event) { | |
var that = $(this); | |
that.on('click', onMapClickHandler); | |
that.off('mouseleave', onMapMouseleaveHandler); | |
that.find('iframe').css("pointer-events", "none"); | |
// pointer-events needs to be added as a style on the iframe | |
} |
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
// Gets a JSDraw instance which renders to a PIXI graphics object. | |
// graphics: an instance of PIXI.Graphics | |
// scale: the scaling factor to convert from Box2D coordinates to screen pixels | |
function getPIXIDebugDraw(graphics, scale) { | |
function getColorFromDebugDrawCallback(color) { | |
var col = Box2D.wrapPointer(color, Box2D.b2Color); | |
var red = (col.get_r() * 255 * 255 * 255)|0; | |
var green = (col.get_g() * 255 * 255)|0; | |
var blue = (col.get_b() * 255)|0; | |
return red + green + blue; |
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
/** | |
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
* | |
* To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
* the height of element `.foo` —which is a full width and height cover image. | |
* | |
* iOS Resolution Quick Reference: http://www.iosres.com/ | |
*/ | |
IE9, IE10, and IE11 don't properly scale SVG files added with img
tags when viewBox
, width
and height
attributes are specified. View this codepen on the different browsers.
Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.
As per this answer on Stackoverflow, the issue can be resolved by removing just the width
and height
attributes.
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
function listeners () { | |
demo.jqContainer.mousedown(mouseDown); | |
demo.jqContainer.mouseup(mouseUp); | |
demo.jqContainer.mousemove(marqueeSelect); | |
$(document).mousemove(resetMarquee); | |
} | |
function resetMarquee () { | |
mouseup = true; | |
mousedown = false; |
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
Template.example.events({ | |
'change input': function(ev) { | |
_.each(ev.srcElement.files, function(file) { | |
Meteor.saveFile(file, file.name); | |
}); | |
} | |
}); |
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
#!/usr/bin/env python | |
# Copyright 2013 Evernote Corporation. All rights reserved. | |
import base64 | |
import sys | |
# Copy the base64 string from the ENEX file and put it into a file | |
# Pipe base64-encoded data to STDIN |
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
"""Download stories of a Pivotal Tracker project. | |
You need the project ID (an int) and your API token. The latter can be | |
obtained in ``https://www.pivotaltracker.com/profile``, or using curl:: | |
$ curl -u username:password -X GET https://www.pivotaltracker.com/services/v3/tokens/active | |
""" | |
import getpass | |
import pickle |
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
function rightWay(obj) { | |
for (var key in obj) { | |
// Ignore properties that are inherited. | |
if (!obj.hasOwnProperty(key)) { | |
continue; | |
} | |
console.log(key); | |
} | |
} |