Skip to content

Instantly share code, notes, and snippets.

View azzgo's full-sized avatar
Zen in daily Life

Ishan azzgo

Zen in daily Life
View GitHub Profile

Useful *nix tricks

Commands

General Useful Commands

Put running process to background: Ctrl+Z

Put process back to foreground to continue work: fg

#! --coding: utf-8--
from Tkinter import *
import random
master = Tk()
master.title("康威生命游戏")
WIDTH=700
HEIGHT=700
@azzgo
azzgo / useref-plugin.js
Last active February 15, 2017 04:55
UserefPlugin
var useref = require('useref');
var { keys } = require('lodash');
var gulp = require('gulp');
var concat = require('gulp-concat');
var nano = require('gulp-cssnano');
var uglify = require('gulp-uglify');
var runSequence = require('run-sequence');
var path = require('path');
var helpers = require('./helpers')
@azzgo
azzgo / upload-server-without-3rd-library.js
Created June 23, 2018 05:20
simple upload node server without 3rd library
// some code from <https://stackoverflow.com/questions/46629086/node-js-file-upload-server-without-third-party-module>
var http = require('http');
var fs = require('fs')
var buffer = require('buffer')
function parseForm(boundary, data){
var form = {};
var delimiter = Buffer.from("\r\n--" + boundary);
var body = extract(data, "--" + boundary + "\r\n");
@azzgo
azzgo / rtc-commit-via-cli.sh
Created July 25, 2018 04:29
IBM RTC using lscm.bat commit(Windows) in ci
#!/bin/sh
## ensure git bash is installed on windows
set -e;
echo "clean project";
rm -rf dist.zip dist/;
@azzgo
azzgo / add.hs
Last active December 6, 2018 20:22
simple add function for natural number
{-# LANGUAGE OverloadedStrings #-}
-- 半加器
bitAdd :: String -> String -> (String, String)
-- 1 + n
bitAdd "1" "2" = ("0", "3")
bitAdd "1" "1" = ("0", "2")
bitAdd "1" "3" = ("0", "4")
bitAdd "1" "4" = ("0", "5")
@azzgo
azzgo / change-font-family.user.js
Last active April 12, 2023 00:28
Excalidraw 更换默认手写体
// ==UserScript==
// @name Trello Board Information Extractor
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Extract and display Trello board information in a modal
// @author ISON
// @match https://*.trello.com/*
// @grant none
// ==/UserScript==
@azzgo
azzgo / quil-marks.js
Created July 18, 2024 05:29
quil-marks.js
import "./style.css";
import "quill/dist/quill.snow.css";
import Quill from "quill";
const editorEl = document.getElementById("editor");
const markerListEl = document.getElementById('marker-list');
const markers = {}
@azzgo
azzgo / dom-mark-utils.js
Last active July 20, 2024 14:33
一个单文件实现标记和重定位,核心逻辑和思路,完全 copy from alienzhou/web-highlighter
/**
* @description minimal mark and relocation utils files
* all ideas extract from alienzhou/web-highlighter
**/
const ROOT_IDX = -2;
const UNKNOWN_IDX = -1;
function genDomMeta($node, offset, $root) {