Skip to content

Instantly share code, notes, and snippets.

View daminhtung's full-sized avatar
💭
How to code by hand?

Nguyen Van Tung daminhtung

💭
How to code by hand?
  • Ha Noi - VietNam
View GitHub Profile

Docker

  1. Build Image:

docker build -t <your username>/node-web-app .

  1. Run Docker image:

docker run -p 49160:8080 -d <your username>/node-web-app

  1. Go inside Docker Container:
// MARK: - Adding a header to a single request
func doRequestWithHeaders1() {
let headers: HTTPHeaders = [
"X-Mashape-Key": MY_API_KEY,
"Accept": "application/json"
]
Alamofire.request("https://mashape-community-urban-dictionary.p.mashape.com/define?term=smh", headers: headers)
.responseJSON { response in
debugPrint(response)
@abhishekbhardwaj
abhishekbhardwaj / .eslintrc
Created March 19, 2019 20:58
ESLint for Typescript powered React Native Projects
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended",
"universe/native",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint"],
"settings": {
"import/resolver": {
@cmoulton
cmoulton / Custom HTTP Headers with Swift and Alamofire.swift
Last active July 15, 2022 12:37
Custom HTTP Headers with Swift 3 or 4 and Alamofire 4.0-4.7: See https://grokswift.com/custom-headers-alamofire4-swift3/ for explanations
// MARK: - Adding a header to a single request
func doRequestWithHeaders1() {
let headers: HTTPHeaders = [
"X-Mashape-Key": MY_API_KEY,
"Accept": "application/json"
]
Alamofire.request("https://mashape-community-urban-dictionary.p.mashape.com/define?term=smh", headers: headers)
.responseJSON { response in
debugPrint(response)