Skip to content

Instantly share code, notes, and snippets.

@takp
takp / file0.txt
Last active Apr 13, 2016
AWS Elastic Beanstalk、Nginx + Passenger (standalone)の環境設定 ref: http://qiita.com/tak_nishida/items/cf30a2d373744943b943
View file0.txt
$ passenger start --nginx-config-template nginx.conf.erb
@deminoth
deminoth / gist:6df889c0d5e35b9f4b54
Last active Aug 29, 2015
카카오 자바스크립트 SDK 비동기로드 asynchronously load Kakao Javascript SDK
View gist:6df889c0d5e35b9f4b54
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() {
@ghinda
ghinda / object-to-form-data.js
Last active Jul 4, 2020
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
View object-to-form-data.js
// 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) {
@andyburke
andyburke / facebook-photo-post-javascript.js
Created Dec 19, 2011
How to post a photo to Facebook from client-side Javascript
View facebook-photo-post-javascript.js
// 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 ) {
You can’t perform that action at this time.