Skip to content

Instantly share code, notes, and snippets.

View zcmgyu's full-sized avatar
😷

Long Nguyen zcmgyu

😷
  • HumanCrest Co., Ltd
  • Vietnam & Japan
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zcmgyu
zcmgyu / convert-rico-for-object-detection.ipynb
Created February 10, 2022 09:15 — forked from dusskapark/convert-rico-for-object-detection.ipynb
Convert RICO for Object Detection.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

nginx sites-available folder not found

create the sites-available and sites-enabled folder

sudo mkdir /etc/nginx/sites-available
sudo mkdir /etc/nginx/sites-enabled

edit the http block inside /etc/nginx/nginx.conf and add this line

include /etc/nginx/sites-enabled/*;
@zcmgyu
zcmgyu / Keeping a fork up to date.md
Last active December 9, 2020 10:53 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@zcmgyu
zcmgyu / React + ESLint + Babel + Airbnb Javascript Style Guide + Prettier + VS Code (2021).md
Last active August 14, 2023 11:44
React + ESLint + Babel + Airbnb Javascript Style Guide + Prettier + VS Code

Setup

Setup ESLint, Pritter, Airbnb JS Style in Create React App project with VS Code editor

  • Plugins: Prettier, Html, React Hooks

Prerequisites

Latest node, VSCode, npm, yarn

@zcmgyu
zcmgyu / test.js
Created August 22, 2019 08:01 — forked from icirellik/test.js
Pass data between beforeEach, afterEach and it in mocha tests.
var expect = require('expect');
describe.only('Sample', function () {
beforeEach(function () {
this.currentTest.value = 'Winning!';
});
it('Uses current test data', function () {
expect(this.test.value).to.equal('Winning!');
@zcmgyu
zcmgyu / gist:51ad5cb03daa30f34b45ea8aebab82b6
Created June 28, 2019 17:11
Appium@1.14@beta2-error-log
[XCUITest] Launching WebDriverAgent on the device
[WebDriverAgent] Fetching dependencies
[WebDriverAgent] Installing/updating dependencies for platforms 'iOS', 'tvOS'
[debug] [WebDriverAgent] *** Checking out CocoaAsyncSocket at "7.6.3"
[debug] [WebDriverAgent] *** Checking out RoutingHTTPServer at "v1.0.2"
[debug] [WebDriverAgent] *** Checking out YYCache at "1.1.0"
[WebDriverAgent] Failed to check out repository into /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/Carthage/Checkouts/CocoaAsyncSocket: Could not create working directory (Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “CocoaAsyncSocket” in the folder “Checkouts”." UserInfo={NSFilePath=/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/Carthage/Checkouts/CocoaAsyncSocket, NSUnderlyingError=0x7f9de412e4c0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}})
[debug] [BaseDriver] Event 'wdaStartFailed' logged at 1561741067516 (01:57:47 GMT+0900 (Japan Standar
{
"englishforkids": {
"ads": true
}
}
@zcmgyu
zcmgyu / authorize.js
Created June 29, 2018 02:30 — forked from kndt84/authorize.js
Sample code: how to refresh session of Cognito User Pools with Node.js and Express
const AWS = require('aws-sdk');
const CognitoUserPool = require('amazon-cognito-identity-js-node').CognitoUserPool;
const CognitoUserSession = require('amazon-cognito-identity-js-node').CognitoUserSession;
const CognitoUser = require('amazon-cognito-identity-js-node').CognitoUser;
const CognitoIdToken = require('amazon-cognito-identity-js-node').CognitoIdToken;
const CognitoAccessToken = require('amazon-cognito-identity-js-node').CognitoAccessToken;
const CognitoRefreshToken = require('amazon-cognito-identity-js-node').CognitoRefreshToken;
const cfg = require('config').config;
const COGNITO_IDENTITY_POOL_ID = cfg.COGNITO_IDENTITY_POOL_ID;