This file contains hidden or 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
UnityWebRequest www = UnityWebRequest.Put(URL_01, "{\"name\":\"user_01\",\"address\":{\"raw\":\"MountFiji\"}}"); | |
www.SetRequestHeader ("Content-Type", "application/json"); | |
yield return www.SendWebRequest(); | |
if (www.isNetworkError || www.isHttpError) | |
{ | |
Debug.Log(www.error); | |
} | |
else |
This file contains hidden or 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
'use strict'; | |
const { | |
sanitizeEntity | |
} = require('strapi-utils'); | |
const buildError = (httpStatus, payload) => { | |
return { | |
status: httpStatus, | |
body: JSON.stringify({ | |
error: payload |
This file contains hidden or 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
const { createCoreService } = require('@strapi/strapi').factories; | |
module.exports = createCoreService('api::pack.pack', ({ strapi }) => ({ | |
// Method 3: Replacing a core service | |
async findOne(packId, params = {}) { | |
const entry = await strapi.db.query('api::pack.pack').findOne({ | |
select: ['label', 'description', 'version'], | |
where: { packId: packId }, |
This file contains hidden or 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
server { | |
listen 80; | |
server_name www.domain.com domain.com; | |
# redirects both www and non-www to ssl port with http (NOT HTTPS, forcing error 497) | |
return 301 http://domain.com$request_uri; | |
} | |
server { | |
listen 433 ssl http2 default_server; |
This file contains hidden or 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
// mgo driver. | |
package main | |
import ( | |
"github.com/globalsign/mgo" | |
"github.com/globalsign/mgo/bson" | |
"log" | |
"sync" | |
"time" | |
) |
This file contains hidden or 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
[ | |
{ | |
"countryName": "Afghanistan", | |
"countryCode": "AF", | |
"callingCode": "+93", | |
"flag": "https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Afghanistan.svg" | |
}, | |
{ | |
"countryName": "Aland Islands", | |
"countryCode": "AX", |
This file contains hidden or 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
let getDimentions = (length, height) => ({length, height}); | |
// It is same as | |
getDimentions = (length, height) => { | |
return {length: length, height: height}; | |
}; | |
// function arguments defaults: Old way | |
getDimentions = (length, height) => { | |
if (!length) { |
This file contains hidden or 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
/** | |
* To get started install | |
* express bodyparser jsonwebtoken express-jwt | |
* via npm | |
* command :- | |
* npm install express bodyparser jsonwebtoken express-jwt --save | |
*/ | |
// Bringing all the dependencies in | |
const express = require('express'); |
This file contains hidden or 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
/* HTML */ | |
<div class="container"> | |
<div class="child"></div> | |
<div> | |
/* Basic Style */ | |
.container { | |
width: 500px; |
This file contains hidden or 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
var swipeFunc = { | |
touches : { | |
"touchstart": {"x":-1, "y":-1}, | |
"touchmove" : {"x":-1, "y":-1}, | |
"touchend" : false, | |
"direction" : "undetermined" | |
}, | |
touchHandler: function(event) { | |
var touch; | |
if (typeof event !== 'undefined'){ |