Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name XXL-Job enhancer
// @namespace http://tampermonkey.net/
// @version 2024-11-19
// @description xxl-job enhancer
// @author You
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @match *://**/*xxljob*/jobinfo*
@rexxiang
rexxiang / jenkins-quick-build.js
Last active January 4, 2024 01:33
quick build for jenkins
// ==UserScript==
// @name Jenkins quick build
// @namespace http://tampermonkey.net/
// @version 2023-12-22
// @description quick build from list
// @author Rex
// @match *://*/view/*
// @match *://*/job/*
// @match *://*/user/*/my-views/view/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
@rexxiang
rexxiang / hkt.rs
Created October 9, 2022 12:47 — forked from 14427/hkt.rs
Higher-kinded type trait
use std::rc::Rc;
trait HKT<U> {
type C; // Current type
type T; // Type with C swapped with U
}
macro_rules! derive_hkt {
($t:ident) => {
impl<T, U> HKT<U> for $t<T> {
@rexxiang
rexxiang / html-to-image.js
Created July 10, 2018 09:40
save html page to image
const chromeLauncher = require('chrome-launcher');
const CDP = require('chrome-remote-interface');
const argv = require('minimist')(process.argv.slice(2));
const file = require('fs');
// CLI Args
const options = {
url: argv.url || 'http://www.baidu.com',
format: argv.format === 'jpeg' ? 'jpeg' : 'png',
viewportWidth: argv.viewportWidth || 1280,
@rexxiang
rexxiang / gist:73d7f8f0691d18e440e77bfe927122e1
Created August 30, 2017 12:11 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@rexxiang
rexxiang / ss-go.dockerfile
Last active December 4, 2017 14:51
shadowsocks docker file for go server
FROM alpine:latest
MAINTAINER Rex
ENV pwd _
RUN apk --no-cache add wget gzip \
&& cd / \
&& wget https://github.com/shadowsocks/shadowsocks-go/releases/download/1.1.5/shadowsocks-server-linux64-1.1.5.gz --no-check-certificate \
&& gzip -d shadowsocks-server-linux64-1.1.5.gz \
&& mv shadowsocks-server-linux64-1.1.5 server \
&& chmod +x server \
@rexxiang
rexxiang / vs2017-offline-downloader.ps1
Last active April 18, 2017 02:28
download or update vs 2017 offline packages
Param(
[string]$OfflineDir = ".\vs2017offline"
)
Set-Location $PSScriptRoot
$installerDir = ".\.vs2017.installer"
$installer = "$installerDir\vs_enterprise.exe"
# download installer
@rexxiang
rexxiang / YuvBytesToBpp24Bitmap.cs
Created July 11, 2016 03:49
yuv422 to bitmap (using OpenCV.net)
public static Bitmap YuvBytesToBpp24Bitmap(byte[] yuvBytes, int width, int height) {
if (yuvBytes == null || yuvBytes.Length == 0) {
return null;
}
const PixelFormat format = PixelFormat.Format24bppRgb;
var image = YuvBytesToIplImage(yuvBytes, width, height);
var bitmap = new Bitmap(image.Width, image.Height, image.WidthStep, format, image.ImageData);
return bitmap;
namespace WebSocket
// Appache 2.0 license
// References:
// [1] Proposed WebSockets Spec December 2011 http://tools.ietf.org/html/rfc6455
// [2] John McCutchan (Google Dart Team Member) http://www.altdevblogaday.com/2012/01/23/writing-your-own-websocket-server/
// [3] A pretty good Python implemenation by mrrrgn https://github.com/mrrrgn/websocket-data-frame-encoder-decoder/blob/master/frame.py
// [4] WebSockets Organising body http://www.websocket.org/echo.html
// [5] AndrewNewcomb's Gist (starting point) https://gist.github.com/AndrewNewcomb/711664
@rexxiang
rexxiang / migrate-git-server.ps1
Created March 31, 2016 09:23
migrate git repository from old server to new server
Param(
[Parameter(Mandatory=$true)]
[string]$OriginUrl,
[Parameter(Mandatory=$true)]
[string]$TargetUrl
)
$dir = ([System.Uri]$OriginUrl).Segments | select -Last 1
if(Test-Path $dir) {