Skip to content

Instantly share code, notes, and snippets.

View truongminh's full-sized avatar

Nguyễn Trường Minh truongminh

View GitHub Profile
@truongminh
truongminh / flappy.html
Created December 6, 2020 14:33 — forked from gullyn/flappy.html
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@truongminh
truongminh / bash.generate.random.alphanumeric.string.sh
Created November 25, 2019 09:04 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@truongminh
truongminh / init-angular2-ts-jspm
Last active August 29, 2015 14:25 — forked from jimthedev/init-angular2-ts-jspm
Angular2, TypeScript, JSPM starter script
# DESCRIPTION
# Performs the commands needed to download and set up a new angular2 project using typescript and jspm
#
# Assumes you have these:
# - git
# - node / io.js
# - npm
# - npm install -g jspm@beta **NOTE**: you must have the beta release of jspm installed
#
# USAGE
@truongminh
truongminh / tmq.c
Created May 29, 2013 06:13 — forked from tanmaykm/tmq.c
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
/**
* related blogpost at: http://sidekick.windforwings.com/2012/05/inter-thread-communication-socketpairs.html