Skip to content

Instantly share code, notes, and snippets.

View x13945's full-sized avatar
😀
I may be slow to respond.

Shaw x13945

😀
I may be slow to respond.
View GitHub Profile
@x13945
x13945 / .zshrc
Created February 18, 2017 16:15
Ubuntu16.04LTS zshrc
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="3den"
# Uncomment the following line to use case-sensitive completion.
@x13945
x13945 / .i3status.conf
Last active June 15, 2017 03:28
Ubuntu16.04LTS I3-WM Config
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
#output_format = "dzen2"
@x13945
x13945 / Default (Linux).sublime-keymap
Created August 5, 2017 11:34
Sublime and it's plugin's config
[
{ "keys": ["alt+m"], "command": "markdown_preview_select", "args": {"target": "browser"} }
]
@x13945
x13945 / ChinaPhoneNumber.js
Created April 23, 2018 02:14
RegEx Based Verify China Phone Number
// includes China Mobile, China Unicom, China Telecom
const isChinaPhoneNumber = phone => /^1(?:70\d|(?:9[89]|8[0-24-9]|7[135-8]|66|5[0-35-9])\d|3(?:4[0-8]|[0-35-9]\d))\d{7}$/.test(phone)
@x13945
x13945 / OkHttp3Stack.java
Created June 14, 2018 07:21 — forked from alashow/OkHttp3Stack.java
An OkHttp backed HttpStack for Volley (okhttp3 version)
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* 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, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@x13945
x13945 / logcatRN.py
Last active September 17, 2018 10:39
View android logcat for react-native. Support multi device connected.
#!/usr/bin/env python
# coding:utf-8
# This script is aimed to grep logs for React-Native.
import os
import sys
def getDeviceId():
devices = []
command = "adb devices -l | sed '1d'| awk '{print $1}'"
@x13945
x13945 / TaskTest
Last active October 12, 2018 07:57
CodeTest
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
public class TaskTest {
@x13945
x13945 / postinstall.js
Created October 16, 2018 04:51
Fix react-native-scrollable-tab-view Trailing Comma Error
/**
*
* After react-native v0.56.0, `react-native-scrollable-tab-view` case app failed to run. Npm server show below:
```
error: bundling failed: SyntaxError: /node_modules/react-native-scrollable-tab-view/SceneComponent.js: A trailing comma is not permitted after the rest element (9:32)
7 |
8 | const SceneComponent = (Props) => {
@x13945
x13945 / clean.js
Created January 19, 2019 14:48
Clean up git repos recursive
const path = require("path");
const process = require("child_process");
const findCommand = "find";
const dir2Clean = __dirname;
const args = [dir2Clean, ..."-type d -name .git".split(" ")];
const cleanCommand = "git clean -xdf .";
const findSizeCommand = "du -hd0 " + dir2Clean;
const sizeBeforeClean = process
@x13945
x13945 / css.config
Created January 19, 2019 15:20
Markdown here css config
.markdown-here-wrapper {
}
/* To add site specific rules, you can use the `data-md-url` attribute that we
add to the wrapper element. Note that rules like this are used depending
on the URL you're *sending* from, not the URL where the recipient views it.
*/
/* .markdown-here-wrapper[data-md-url*="mail.yahoo."] ul { color: red; } */