Skip to content

Instantly share code, notes, and snippets.

View othree's full-sized avatar
:accessibility:
On the way to refactoring

othree othree

:accessibility:
On the way to refactoring
View GitHub Profile
sudo pacman -Syu
sudo pacman -S mercurial ncurses mariadb mariadb-clients fcgiwrap zsh git tig autoconf libtool pcre openssl neovim
# perl
sudo pacman -S clang base-devel
# clang
# https://wiki.archlinux.org/index.php/Clang
git log --oneline --graph --ancestry-path 3023de4...green
#!/bin/bash
Q=85
while [[ $# > 1 ]]
do
key="$1"
if [ $2 ]
then
<?php
if ($_SERVER['HTTPS'] == on) {
$protocol = 'https';
} else {
$protocol = 'http';
}
header('Location: ' . $protocol . '://' . preg_replace('/g0b.tw$/', 'g0v.tw', $_SERVER['HTTP_HOST']) . $_GET['q'] , true, 301);
#!/bin/bash
# Stops accidental commits to master and develop. https://gist.github.com/stefansundin/9059706
# Install:
# cd path/to/git/repo
# curl -fL -o https://gist.githubusercontent.com/othree/a5ad2dd81a5957a06867/raw/3abf8b2fbc9ce614af83e2522f23c163c78c97c6/Not%2520commit%2520to%2520master
# chmod +x .git/hooks/pre-commit
BRANCH=`git rev-parse --abbrev-ref HEAD`
if [[ "$BRANCH" == "master" ]]; then
var z = new Promise();
z.catch( () => {} ).then(alwaysHandler);
// Empty function is required
echo "Touch Files:"
ls `git rev-parse --show-toplevel`/tmp/*.reload
touch `ls \`git rev-parse --show-toplevel\`/tmp/*.reload`
(function () {
var decode = ProtoBuf.Reflect.Message.Field.prototype.decode;
ProtoBuf.Reflect.Message.Field.prototype.decode = function () {
var value = decode.apply(this, arguments);
if (ProtoBuf.TYPES["enum"] === this.type) {
var values = this.resolvedType.children;
for (var i=0; i<values.length; i++){
if (values[i].id == value){
return values[i].name;
{
"!name": "fetch",
"Headers": {
"!type": "fn(init?: object)",
"!doc": "Represents response/request headers, allowing you to query them and take different actions depending on the results.",
"!url": "https://developer.mozilla.org/en-US/docs/Web/API/Headers",
"prototype": {
"append": {
"!type": "fn(name: string, value: string)",
"!url": "https://developer.mozilla.org/en-US/docs/Web/API/Headers/append",