Skip to content

Instantly share code, notes, and snippets.

View liaohuqiu's full-sized avatar
🎯
Focusing

Huqiu Liao liaohuqiu

🎯
Focusing
View GitHub Profile
#define OPENCL_PLATFORM_UNKNOWN 0
#define OPENCL_PLATFORM_AMD 1
#define OPENCL_PLATFORM_CLOVER 2
#define OPENCL_PLATFORM_NVIDIA 3
#define OPENCL_PLATFORM_INTEL 4
#ifdef cl_clang_storage_class_specifiers
#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
#endif
package kxi.rpc.test.basic;
class MergeSortSolution {
private static void merge(int arr[], int left, int mid, int right) {
int leftCount = mid - left + 1;
int rightCount = right - mid;
int leftArr[] = new int[leftCount];
int rightArr[] = new int[rightCount];
function exe_cmd() {
echo $1
eval $1
}
function ensure_dir()
{
if [ ! -d $1 ]; then
exe_cmd "mkdir -p $1"
fi
sourceServer=172.16.1.121
function syncusers() {
scp $sourceServer:/etc/passwd /tmp/passwd.$sourceServer
scp $sourceServer:/etc/group /tmp/group.$sourceServer
scp $sourceServer:/etc/shadow /tmp/shadow.$sourceServer
# First, make a list of non-system users that need to be moved.
local UGIDLIMIT=500
public class ImageUrlManager {
private static final String HTTP = "http";
private static final String GIF = ".gif";
private static final String KEY_IMAGEMOGR2 = "?imageMogr2";
/**
* Refer to: https://portal.qiniu.com/myTickets/ticketDetail?id=36037
* There is one bug in qiniu.com, they may fail to convert gif to
# using route
route del default gw 192.168.0.1
route add default gw 192.168.0.4
# or using ip
ip route del default
ip route add default via 192.168.0.4
@liaohuqiu
liaohuqiu / gist:4ee77b9b03afcdecc80252252378d367
Created June 9, 2016 00:38
Find out the full duration time of a YouTube playlist
var list = document.getElementsByClassName('pl-video-time');
var time = 0;
function toS(hms) {
var a = hms.split(':');
while (a.length < 3) {
a.unshift(0);
}
var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]);
return seconds;