Skip to content

Instantly share code, notes, and snippets.

@goodseller
goodseller / README.md
Created September 13, 2017 14:24 — forked from joyrexus/README.md
form-data vs -urlencoded

Nice answer on stackoverflow to the question of when to use one or the other content-types for POSTing data, viz. application/x-www-form-urlencoded and multipart/form-data.

“The moral of the story is, if you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data. Otherwise, use application/x-www-form-urlencoded.”


Matt Bridges' answer in full:

The MIME types you mention are the two Content-Type headers for HTTP POST requests that user-agents (browsers) must support. The purpose of both of those types of requests is to send a list of name/value pairs to the server. Depending on the type and amount of data being transmitted, one of the methods will be more efficient than the other. To understand why, you have to look at what each is doing

@goodseller
goodseller / multiple_ssh_setting.md
Created December 12, 2016 14:11 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@goodseller
goodseller / SceneLoader.cs
Created September 29, 2016 17:24 — forked from nickpettit/SceneLoader.cs
This Unity script will add fields in the inspector that allow you to enter a scene number. When the user presses the space bar, Unity will load the new scene.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class SceneLoader : MonoBehaviour {
private bool loadScene = false;
[SerializeField]
private int scene;
@goodseller
goodseller / ScriptableAssetCreator.cs
Created September 14, 2016 07:10 — forked from prodigga/ScriptableAssetCreator.cs
Right click on any script in your project that defines a ScriptableObject and create a ScriptableObject asset out of it! See here http://imgur.com/a/e7FDR#0 NOTE: This script was made somewhat redundant with the introduction of the [CreateAssetMenu] attribute - look it up :)
using UnityEditor;
using UnityEngine;
/// <summary>
/// Right click on any script in your project that defines a ScriptableObject
/// and create a ScriptableObject asset out of it! See here http://imgur.com/a/e7FDR#0
/// </summary>
/// <author>Tim Aksu</author>
/// <email>timur.s.aksu@gmail.com</email>
public static class ScriptableObjectUtility
@goodseller
goodseller / CameraExtensions.cs
Created August 8, 2016 15:06 — forked from djfdat/CameraExtensions.cs
Unity3D Camera Shake Extension Method
// Unity3D Camera Shake Extension Method
//
// Credits: Boxhead Productions, gRntaus, https://youtu.be/f3kx1_5e6_0
//
// Example usage: StartCoroutine(Camera.main.LinearShake(0.1f, 0.1f, CameraAxis.All)
using UnityEngine;
using System.Collections;
public static class CameraExtensions
@goodseller
goodseller / better-nodejs-require-paths.md
Created January 17, 2016 05:24 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions