Skip to content

Instantly share code, notes, and snippets.

View gcaaa31928's full-sized avatar
👋

Red Huang gcaaa31928

👋
View GitHub Profile
@gcaaa31928
gcaaa31928 / processHeartbeatsIntoDurations.js
Created December 12, 2024 18:08 — forked from alanhamlett/processHeartbeatsIntoDurations.js
Turn an array of heartbeats into durations by combining heartbeats that are within Keystroke Timeout minutes from each other.
/*
BSD 3-Clause License
Copyright (c) 2023 Alan Hamlett.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
@gcaaa31928
gcaaa31928 / collectenv.groovy
Last active March 28, 2022 03:43 — forked from mramanathan/collectenv.groovy
Jenkins Pipeline: How to run stage(s) in all nodes that match label string ?
import jenkins.model.*
collectBuildEnv = [:]
@NonCPS
def getNodes(String label) {
jenkins.model.Jenkins.instance.nodes.collect { thisAgent ->
if (thisAgent.labelString.contains("${label}")) {
// this works too
// if (thisAagent.labelString == "${label}") {
@gcaaa31928
gcaaa31928 / gen_cert.sh
Created February 14, 2022 02:07 — forked from adamrunner/gen_cert.sh
bash script to generate a self signed certificate for development use
#!/bin/bash
# Bash shell script for generating self-signed certs. Run this in a folder, as it
# generates a few files. Large portions of this script were taken from the
# following artcile:
#
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html
#
# Additional alterations by: Brad Landers
# Date: 2012-01-27
@gcaaa31928
gcaaa31928 / docker-compose.yaml
Created February 12, 2022 13:49 — forked from maeneak/docker-compose.yaml
HASSIO (Home Assistant Supervised) for Synology DSM 7 (Unsupported Installation but allows updates and fully functional)
version: '3'
services:
hassio:
image: homeassistant/amd64-hassio-supervisor
container_name: hassio_supervisor
privileged: true
security_opt:
- seccomp:unconfined
- apparmor:unconfined
@gcaaa31928
gcaaa31928 / __note.md
Created August 14, 2021 09:17 — forked from fredrike/__note.md
hass.io on Synology
@gcaaa31928
gcaaa31928 / Jenkinsfile
Created February 24, 2020 05:26 — forked from ftclausen/Jenkinsfile
Jenkins pipeline - An approach to get all commits since the last successful build.
// -*- mode: groovy -*-
// vim: set filetype=groovy :
node( 'some_node' ) {
stage( "Phase 1" ) {
sshagent( credentials: [ 'some_creds' ] ) {
checkout scm
def lastSuccessfulCommit = getLastSuccessfulCommit()
def currentCommit = commitHashForBuild( currentBuild.rawBuild )
if (lastSuccessfulCommit) {
let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait'))
let s:syno_tab = -1
let s:syno_buf = -1
function! s:shellesc_cmd(arg)
let escaped = substitute(a:arg, '[&|<>()@^]', '^&', 'g')
let escaped = substitute(escaped, '%', '%%', 'g')
let escaped = substitute(escaped, '"', '\\^&', 'g')
let escaped = substitute(escaped, '\(\\\+\)\(\\^\)', '\1\1\2', 'g')
return '^"'.substitute(escaped, '\(\\\+\)$', '\1\1', '').'^"'
this.pollTaskConfig = {
interval: this.pollingInterval,
api: 'SYNO.Core.DSMNotify',
method: 'notify',
version: 1,
params: {
@gcaaa31928
gcaaa31928 / .git-commit-template.txt
Created September 12, 2018 13:22 — forked from jmaxhu/.git-commit-template.txt
一份建议的git commit模板
# <类型>: (类型的值见下面描述) <主题> (最多50个字)
# 解释为什么要做这些改动
# |<---- 请限制每行最多72个字 ---->|
# 提供相关文章和其它资源的链接和关键字
# 例如: Github issue #23
# --- 提交 结束 ---
# 类型值包含
@gcaaa31928
gcaaa31928 / mouse_control.py
Created December 21, 2015 06:03 — forked from sheharyarn/mouse_control.py
Control your Mouse using your Eye Movement
import zmq
from pymouse import PyMouse
#mouse setup
m = PyMouse()
x_dim, y_dim = m.screen_size()
#network setup
context = zmq.Context()
socket = context.socket(zmq.SUB)