Skip to content

Instantly share code, notes, and snippets.

@Duobe
Duobe / all_translations.dart
Last active July 31, 2019 15:19
单例实现只实例化一次,暴露一个全局变量allTranslations
import 'dart:async';
import 'dart:convert';
import 'dart:ui';
import 'package:flutter/services.dart';
import 'package:shared_preferences/shared_preferences.dart';
///
/// Preferences related
///
const String _storageKey = "MyApplication_";
@Duobe
Duobe / all_translations.dart
Created July 31, 2019 13:52 — forked from boeledi/all_translations.dart
Module to handle multi-lingual
import 'dart:async';
import 'dart:convert';
import 'dart:ui';
import 'package:flutter/services.dart';
import 'package:shared_preferences/shared_preferences.dart';
///
/// Preferences related
///
const String _storageKey = "MyApplication_";
@Duobe
Duobe / .travis.yml
Created March 25, 2019 11:19 — forked from maboloshi/.travis.yml
maboloshi.github.io 的.travis.yml, gulpfile.js设置存档
language: node_js
node_js:
- '6'
# 缓存依赖,节省持续集成时间
cache:
directories:
- node_modules
- themes
@Duobe
Duobe / README-Template.md
Created March 8, 2019 08:41 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Duobe
Duobe / deepCopy.js
Last active February 24, 2019 08:34
function deepCopy (target) {
if (
target === null
|| typeof target === 'number'
|| typeof target === 'boolean'
|| typeof target === 'string'
|| typeof target === undefined
) return target
if (Array.isArray(target)) {
@Duobe
Duobe / cookie.js
Last active December 29, 2018 10:35 — forked from jameshartig/underscoreCookie.js
_.cookie
@Duobe
Duobe / cookie.js
Created December 29, 2018 09:48 — forked from xubo-bj/cookie.js
cookie
@Duobe
Duobe / .eslintrc-parameter-instruction.js
Created December 13, 2018 08:22 — forked from rswanderer/.eslintrc-parameter-instruction.js
ESLint配置文件.eslintrc参数说明
/*
* ESLint的JSON文件是允许JavaScript注释的,但在gist里显示效果不好,所以我把.json文件后缀改为了.js
*/
/*
* ESLint 配置文件优先级:
* .eslintrc.js(输出一个配置对象)
* .eslintrc.yaml
* .eslintrc.yml
@Duobe
Duobe / tslint.json
Created December 13, 2018 05:23 — forked from smartpcr/tslint.json
tslint
{
"extends": ["tslint-react"],
"rulesDirectory": "./node_modules/tslint-microsoft-contrib",
"rules": {
"function-name": [
true,
{
"method-regex": "^[a-z][\\w\\d]+$",
"private-method-regex": "^_[a-z][\\w\\d]+$",
"protected-method-regex": "^[_]?[a-z][\\w\\d]+$",
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 100