Skip to content

Instantly share code, notes, and snippets.

@TonSDe
TonSDe / DispatchQueue.swift
Last active October 23, 2019 04:45
DispatchQueue
// ตัวอย่างการทำงานของ Task
var ID:string = nil
func getDataFromURL() {
let URL:string = "https://xxx...."
Alamofire.request(URL, method: .get, parameters: nil).responseJSON { response in
let dataJSON = JSON(response.result.value!)
if let id:String = dataJSON["data"]["id"].string {
self.ID = id
}
@TonSDe
TonSDe / eb-environment.yaml
Created November 1, 2018 09:26
AWS Elastic Beanstalk : Set Server Env
option_settings:
aws:elasticbeanstalk:application:environment:
AUTH_KEY: 'test'
SECURE_AUTH_KEY: 'test'
LOGGED_IN_KEY: 'test'
NONCE_KEY: 'test'
AUTH_SALT: 'test'
SECURE_AUTH_SALT: 'test'
NONCE_SALT: 'test'
@TonSDe
TonSDe / ebextension-vhost.yaml
Created November 1, 2018 09:20
AWS Elastic Beanstalk : Enable .htaccess
files:
"/etc/httpd/conf.d/hello.conf":
mode: "000644"
owner: root
group: root
content: |
<VirtualHost *:80>
DocumentRoot /var/app/current
<Directory /var/app/current/>
Options Indexes FollowSymLinks
@TonSDe
TonSDe / json
Created November 1, 2018 09:10
Amazon S3 Sample Public Prolicy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::backgets-name-s3/*"
}
# pod init
# pod install
target 'YouProjectName' do
use_frameworks!
# Pods
pod 'Alamofire-Synchronous', '~> 4.0'
end