Skip to content

Instantly share code, notes, and snippets.

View trkhanh's full-sized avatar

Tran Khanh trkhanh

View GitHub Profile
@trkhanh
trkhanh / Contract Killer 3.md
Created January 29, 2021 08:03 — forked from joshuacerbito/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@trkhanh
trkhanh / JS_NGINX.md
Last active May 15, 2021 07:26
Harnessing the Power and Convenience of JavaScript for Each Request with the NGINX JavaScript Module
@trkhanh
trkhanh / PoweCLI_Script_Template_V2_Logs.ps1
Created May 31, 2021 08:25 — forked from 9to5IT/PoweCLI_Script_Template_V2_Logs.ps1
PowerShell: PowerCLI Script Template Version 2 (with logging)
#requires -version 4
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
@trkhanh
trkhanh / bai-tap-ma-tran-x.py
Last active June 5, 2021 04:39
thuat toan vet can
M = 5
N = 5
arrStep = []
def floodFillAlgo(screen, x, y, prevC, newC, step):
# Base cases
if (x < 0 or x >= M or y < 0 or
y >= N or screen[x][y] != prevC or
screen[x][y] == newC):
@trkhanh
trkhanh / hashtable.js
Created July 5, 2021 07:22
Hash Table
class HashTable {
constructor() {
this.table = new Array(127);
this.size = 0;
}
_hash(key) {
let hash = 0;
for (let i = 0; i < key.length; i++) {
hash += key.charCodeAt(i);
@trkhanh
trkhanh / InfixtoPostfix.js
Created August 31, 2021 10:16
polish-algo
// Created an empty array
var stackarr = [];
// Variable topp initialized with -1
var topp = -1;
// Push function for pushing
// elements inside stack
function push(e) {
topp++;
@trkhanh
trkhanh / install-go-to-with-bash-script.md
Created October 17, 2021 05:01 — forked from d2s/install-go-to-with-bash-script.md
Installing Go with command line

NOTE: This is heavily outdated Gist snippet from 2017.


Install Go language with a Bash script

Another alternative to installing Go is to use a simple Bash script. It will download and install Go language under of your own user account.

Note that a system-wide installation might be better for some things

Xoá rồi nhé
@trkhanh
trkhanh / blob.jsx
Last active May 30, 2022 12:53
blob-example
import '@mohayonao/web-audio-api-shim'
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import Player from './components/player'
import FilePicker from './components/file'
import { isAudio, readBlobURL, download, rename, sliceAudioBuffer } from './utils'
import { encode } from './worker-client'
import WebAudio from './webaudio'
import { Box, Button, ButtonGroup, FormControl, InputLabel, Select, MenuItem } from "@mui/material";
import PlayArrow from '@mui/icons-material/PlayArrow'
@trkhanh
trkhanh / index.js
Created June 4, 2022 04:49
db-index
var async = require('async');
var ShareDBError = require('../error');
function DB(options) {
// pollDebounce is the minimum time in ms between query polls
this.pollDebounce = options && options.pollDebounce;
}
module.exports = DB;
// When false, Backend will handle projections instead of DB