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
@samtgarson
samtgarson / get-model-type.spec.ts
Created March 19, 2024 08:57
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,
@dusskapark
dusskapark / convert_rico_for_object_detection_based_on_clay.ipynb
Created February 4, 2022 13:44
Convert_RICO_for_Object_Detection_based_on_CLAY.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dusskapark
dusskapark / convert-rico-for-object-detection.ipynb
Last active March 1, 2024 16:56
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.
@seleniumgists
seleniumgists / -.txt
Created May 26, 2019 04:29
generated automatically from #selenium on seleniumhq slack
ishabbi@Ishs-MacBook-Pro:~$ java -jar selenium-4alpha-custom.jar hub
09:51:23.063 INFO [EventBusConfig.createBus] - Creating event bus: org.openqa.selenium.events.zeromq.ZeroMqEventBus
09:51:23.149 INFO [BoundZmqEventBus.<init>] - XPUB binding to [binding to tcp://*:4442, advertising as tcp://fe80:0:0:0:841:a6e6:c8bc:4133%en0:4442], XSUB binding to [binding to tcp://*:4443, advertising as tcp://fe80:0:0:0:841:a6e6:c8bc:4133%en0:4443]
09:51:23.224 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://fe80:0:0:0:841:a6e6:c8bc:4133%en0:4442 and tcp://fe80:0:0:0:841:a6e6:c8bc:4133%en0:4443
Exception in thread "main" java.lang.IllegalArgumentException: Unable to find event bus class: org.openqa.selenium.events.zeromq.ZeroMqEventBus
at org.openqa.selenium.grid.server.EventBusConfig.createBus(EventBusConfig.java:74)
at org.openqa.selenium.grid.server.EventBusConfig.getEventBus(EventBusConfig.java:44)
at org.openqa.selenium.grid.commands.Hub.lambda$configure$0(Hub.java:107)
at org.openqa.selenium.grid.Main.launc
@merikan
merikan / Jenkinsfile
Last active June 13, 2024 03:56
Some Jenkinsfile examples
Some Jenkinsfile examples
import { createLogger } from 'redux-logger';
const logger = createLogger({
stateTransformer: (state) => {
const newState = {};
const stateObj = state.toObject();
for (const i of Object.keys(stateObj)) {
if (Iterable.isIterable(stateObj[i])) {
newState[i] = stateObj[i].toJS();
@kndt84
kndt84 / authorize.js
Last active May 17, 2024 03:11
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;
@sam-artuso
sam-artuso / setting-up-babel-nodemon.md
Last active November 3, 2023 08:52
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
@rponte
rponte / build.gradle
Last active February 20, 2024 06:44
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")
@icirellik
icirellik / test.js
Created August 25, 2015 20:02
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!');