Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -eu
# buildbox-cli agent
# by @allex <iallex.com> | MIT
#
# Install
# curl -sSLf https://git.io/fpWaM -o /usr/sbin/buildbox-cli-agent && chmod +x /usr/sbin/buildbox-cli-agent
#
# GistID: 7dd3f33104c2c0c01e7a666ef412e0fa
@allex
allex / win_dns.cmd
Last active February 19, 2019 07:27
@echo off
@rem -------------------
@rem
@rem Auto switch DNS for windows (by allex_wang)
@rem
@rem GistID: e3ce838333090e56bbca4765f2e1dda7
@rem
@rem $ curl -sL https://git.io/fpTtr >win_dns.cmd
@rem
@rem -------------------
@allex
allex / chart.png
Created November 8, 2018 06:28 — forked from evanw/chart.png
WebSocket Speed Test
chart.png
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
#!/bin/sh
# vim: set ft=sh fdm=manual ts=2 sw=2 sts=2 tw=85 et:
# ================================================
#
# Helper for release distribute to combo fs
#
# Installation:
# > curl -sL https://git.io/fhNH2 | bash
#
@allex
allex / sha1.d.ts
Last active September 13, 2018 09:04
export function sha1(str: string | ArrayBuffer, opts?: Object): string;
(function (e, t, n) {
'use strict'
var r
typeof Symbol === 'function' && Symbol.iterator
!(function (i) {
function o (e, t) {
var n = (65535 & e) + (65535 & t)
return (e >> 16) + (t >> 16) + (n >> 16) << 16 | 65535 & n
}
@allex
allex / cherry-pick-pr.md
Created August 14, 2018 06:26 — forked from sivel/cherry-pick-pr.md
Basic workflow for creating a cherry-pick pull request for ansible

After submitting a PR to Ansible for the devel branch, and having it merged, the following instructions will help you create a pull request to backport the change to a previous stable branch

These instructions assume that stable-2.5 is the previous release branch.

  1. Update devel, to ensure you have the commit to cherry pick:

    git checkout devel
    git --fetch upstream
    

git merge upstream/devel

@allex
allex / post-merge
Created July 13, 2018 02:57 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
#!/bin/sh
# vim: set ft=sh fdm=manual ts=2 sw=2 sts=2 tw=85 et:
# crontab script for auto deploy
# Author: Allex Wang ([email protected])
# GistID: 75f0772f5f769e9c60b70fc54f55cedc
# GistURL: https://gist.github.com/75f0772f5f769e9c60b70fc54f55cedc
set -eE
set -o pipefail