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 / GitlabGroupCloning.sh
Created December 31, 2021 09:27 — forked from truongngoclinh/GitlabGroupCloning.sh
Clone all projects in gitlab group
#!/usr/bin/env bash
BASE_PATH="your domain"
GITLAB_PRIVATE_TOKEN="your private token"
if [ -z "$1" ]
then
echo "group name is required."
exit 1;
@x13945
x13945 / logcatPkg.py
Created December 4, 2019 15:13
Android adb tools
#!/usr/bin/env python
#coding:utf-8
#This script is aimed to grep logs by application(User should input a packageName and then we look up for the process ids then separate logs by process ids).
import os
import sys
packageName=str(sys.argv[1])
def getDeviceId():
#!/bin/sh
# i3-get-window-criteria - Get criteria for use with i3 config commands
# To use, run this script, then click on a window.
# Output is in the format: [<name>=<value> <name>=<value> ...]
# Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion,
# quotes in "<string>" are not escaped properly. This is a problem with the output of `xprop`,
# reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807
@x13945
x13945 / GenerateHexCode.js
Created May 23, 2019 07:39
生成iterm中快捷键需要对hex code
function toHex(str) {
var result = '';
for (var i = 0; i < str.length; i++) {
result += `0x${str.charCodeAt(i).toString(16)} `;
}
return result;
}
let res = toHex('http')
console.log('====================================');
@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; } */
@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 / 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 / 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 / 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}'"