⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
# Put this method in your helper file to render inline SVG | |
def inline_svg(path) | |
file = File.open("app/assets/images/#{path}", "rb") | |
raw file.read | |
end |
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 mapNumber (number, inMin, inMax, outMin, outMax) { | |
return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; | |
} |
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
// 출처 : http://stackoverflow.com/questions/6150289/how-to-convert-image-into-base64-string-using-javascript | |
/** | |
* Convert an image | |
* to a base64 string | |
* @param {String} url | |
* @param {Function} callback | |
* @param {String} [outputFormat=image/png] | |
*/ | |
function convertImgToBase64(url, callback, outputFormat){ | |
var canvas = document.createElement('CANVAS'), |