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
// This bit is important. It detects/adds XMLHttpRequest.sendAsBinary. Without this | |
// you cannot send image data as part of a multipart/form-data encoded request from | |
// Javascript. This implementation depends on Uint8Array, so if the browser doesn't | |
// support either XMLHttpRequest.sendAsBinary or Uint8Array, then you will need to | |
// find yet another way to implement this. (This is left as an exercise for the reader, | |
// but if you do it, please let me know and I'll integrate it.) | |
// from: http://stackoverflow.com/a/5303242/945521 | |
if ( XMLHttpRequest.prototype.sendAsBinary === undefined ) { |
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
// takes a {} object and returns a FormData object | |
var objectToFormData = function(obj, form, namespace) { | |
var fd = form || new FormData(); | |
var formKey; | |
for(var property in obj) { | |
if(obj.hasOwnProperty(property)) { | |
if(namespace) { |
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
window.kakaoAsyncInit = function() { | |
Kakao.init('your-javascript-key'); | |
}; | |
(function(d, s, id){ | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) {return;} | |
js = d.createElement(s); js.id = id; | |
js.src = "https://developers.kakao.com/sdk/js/kakao.min.js"; | |
var done = false; | |
js.onload = js.onreadystatechange = function() { |
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
$ passenger start --nginx-config-template nginx.conf.erb |