Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
import { createConnection, getConnection, Entity, getRepository } from "typeorm"; | |
import { PrimaryGeneratedColumn, Column } from "typeorm"; | |
@Entity() | |
export class MyEntity { | |
@PrimaryGeneratedColumn() | |
id?: number; | |
@Column() | |
name?: string; |
import { Mutex, MutexInterface } from 'async-mutex' | |
import { Connection, ConnectionManager, ConnectionOptions, EntityManager, QueryRunner } from 'typeorm' | |
import { Driver } from 'typeorm/driver/Driver' | |
import { DriverFactory } from 'typeorm/driver/DriverFactory' | |
import { SqliteDriver } from 'typeorm/driver/sqlite/SqliteDriver' | |
import { SqliteQueryRunner } from 'typeorm/driver/sqlite/SqliteQueryRunner' | |
import { AlreadyHasActiveConnectionError } from 'typeorm/error/AlreadyHasActiveConnectionError' | |
import { QueryRunnerProviderAlreadyReleasedError } from 'typeorm/error/QueryRunnerProviderAlreadyReleasedError' | |
import { app as logger } from './logger' |
This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
Convert .mov/.MP4 to .gif
As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.
This is not limited to developer, anyone has this need can use this method to convert the files.
// The Vue build version to load with the `import` command | |
// (runtime-only or standalone) has been set in webpack.base.conf with an alias. | |
import Vue from 'vue' | |
import App from './App' | |
import VeeValidator, { Validator } from 'vee-validate' | |
import CpfValidator from './components/validators/cpf.validator' | |
import Dictionary from './components/validators/dictionary' | |
import Produto from './components/produtos.vue' | |
Validator.extend('cpf', CpfValidator) |
# force dates to be UTC | |
__timezoneOffset = (new Date).getTimezoneOffset() * 60 * 1000 | |
__dateWrapper = (original) -> | |
-> | |
unless @__hacked | |
@__hacked = yes | |
@setTime @getTime() - __timezoneOffset | |
try | |
res = original.apply @, arguments | |
catch err |
/** | |
* Directive to instantly enable/disable multiple checkboxes based on a master checkbox. | |
* Changing slave checkboxes will update the master checkbox accordingly, including the indeterminate state. | |
* | |
* Usage example: | |
* | |
* <label><input type="checkbox" select-all="theProperties"> Select all</label> | |
* <div ng-repeat="property in properties"> | |
* <label><input type="checkbox" rel="theProperties" ng-model="property.checked"> {{ property.label }}</label> | |
* </div> |
exports.definition = { | |
config: { | |
columns: { | |
// ... | |
}, | |
adapter: { | |
type: "sql", | |
collection_name: "MyModels" | |
} |
#!/usr/bin/env ruby | |
# A quick and dirty implementation of an HTTP proxy server in Ruby | |
# because I did not want to install anything. | |
# | |
# Copyright (C) 2009-2014 Torsten Becker <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, |