Skip to content

Instantly share code, notes, and snippets.

View davidwmartin's full-sized avatar

David W Martin davidwmartin

View GitHub Profile
@odd-poet
odd-poet / convertImgToBase64.js
Created October 16, 2014 14:13
convertImgToBase64
// 출처 : 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'),
@AugustMiller
AugustMiller / map.js
Last active October 2, 2021 14:14
Map a number in one range to a number in another.
function mapNumber (number, inMin, inMax, outMin, outMax) {
return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
}
@tomeara
tomeara / inline_svg_helper.rb
Last active October 25, 2019 13:01
Inline SVG for Rails
# 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
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt