Skip to content

Instantly share code, notes, and snippets.

View giathinh910's full-sized avatar
🎯
Focusing

Thinh Bui giathinh910

🎯
Focusing
View GitHub Profile
@giathinh910
giathinh910 / jest-dayjs-custom-matcher.ts
Created January 11, 2024 14:18
Jest Dayjs custom matchers
import { Dayjs, OpUnitType } from 'dayjs';
const isEqualTime = (expected: Dayjs, unit: OpUnitType = 'ms') => ({
$$typeof: Symbol.for('jest.asymmetricMatcher'),
asymmetricMatch: (actual: Dayjs) => expected.isSame(actual, unit),
toAsymmetricMatcher: () => 'Dayjs<' + expected.toISOString() + '>',
});
export default isEqualTime;
@giathinh910
giathinh910 / simple-paralax-jquery.js
Created July 11, 2020 01:55
Simple paralax effect using JQuery
$('.parallax').css('background-positionY', ($(window).scrollTop() * 0.3) + 'px');
@giathinh910
giathinh910 / launch.json
Created May 14, 2020 01:26
Attach debugger to protractor and current dev server
{
"version": "0.2.0",
"configurations": [
{
"name": "E2E",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/.bin/protractor",
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
td {
white-space: normal;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
--
-- Table structure for table `area_districts`
--
DROP TABLE IF EXISTS `area_districts`;
CREATE TABLE IF NOT EXISTS `area_districts` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`province_id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`),

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql

This file has been truncated, but you can view the full file.
[
{
"name": "Thành phố Hà Nội",
"districts": [
{
"name": "Quận Ba Đình",
"wards": [
{
"name": "Phường Phúc Xá"