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
@zcmgyu
zcmgyu / get-model-type.spec.ts
Created March 19, 2024 13:43 — forked from samtgarson/get-model-type.spec.ts
Custom Safe Reference type in Mobx State Tree
import { types } from 'mobx-state-tree'
import { getModelType, getModelTypes } from './get-model-type'
const TestModel = types.model('models', {
id: types.identifier,
name: types.literal('frodo'),
})
const TestModel2 = types.model('other-models', {
id: types.identifier,
Loading
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
Loading
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 [email protected]: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 / 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 / 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;
@zcmgyu
zcmgyu / setting-up-babel-nodemon.md
Created June 11, 2018 05:40 — forked from sam-artuso/setting-up-babel-nodemon.md
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
@zcmgyu
zcmgyu / build.gradle
Created May 7, 2018 07:45 — forked from rponte/build.gradle
Configuring Gradle compiler encoding
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
eclipseJdt << {
ant.propertyfile(file: ".settings/org.eclipse.core.resources.prefs") {
ant.entry(key: "eclipse.preferences.version", value: "1")
ant.entry(key: "encoding/<project>", value: "utf-8")
@zcmgyu
zcmgyu / CHANGELOG.md
Created December 28, 2017 17:10 — forked from dispix/CHANGELOG.md
OAUTH2 Authentication and token management with redux-saga

Revision 5

  • Fix error parsing

Revision 4

  • Add missing yield in the login function

Revision 3