Skip to content

Instantly share code, notes, and snippets.

View vejuhust's full-sized avatar
🎯
Focusing

Vej vejuhust

🎯
Focusing
  • Beijing, China
View GitHub Profile
@vejuhust
vejuhust / aliases.pub
Last active November 10, 2022 02:52
My Common build\aliases\aliases.pub in Microsoft
b build
bbb build nuke && build -cleanonly && build
bq build nuke && quickbuild $*
e start buildd.err
mc sdv -u fareast\weye ...
s+ sd add $*
s- sd delete $*
s! sd revert $*
sa sdp apply $*
sc sd change

ffmpeg

install

apt-add-repository ppa:jon-severinsson/ffmpeg
apt-get update
apt-get install ffmpeg

generate silent film

@vejuhust
vejuhust / Logger.py
Created February 27, 2017 15:41
Python Wrapper of SoftEtherVPN "vpncmd" Tool
#!/usr/bin/env python3
import logging
# Colorful console
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
@vejuhust
vejuhust / github-flavored-markdown-test-doc.md
Last active October 13, 2017 05:56
github-flavored markdown syntax test document
@vejuhust
vejuhust / estimated.py
Created January 9, 2014 15:31
In Agile development, we usually use hours to estimate our projects, and it's not easy to make it accurate. This little tool might be useful to you.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
x = int(raw_input("how many work items do you have? "))
hours = [4,6,6,8,8,8,8,10,10,12,14]
for i in range(x):
print random.choice(hours)
@vejuhust
vejuhust / listdate.py
Created January 5, 2014 09:28
List past 20 days
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from datetime import datetime
from datetime import timedelta
now = datetime.now()
delta_day = timedelta(days = -1)
for i in range(21):
now += delta_day
@vejuhust
vejuhust / printallccode.sh
Last active December 15, 2015 09:19
print all c code in this folder
#!/bin/sh
TARGETFILE=allinone.c
if [ -e "$TARGETFILE" ]; then
rm -f "$TARGETFILE"
fi
if [ -n "$1" ]; then
printf "$1""\n" >> "$TARGETFILE"
@vejuhust
vejuhust / json_test.php
Last active December 14, 2015 07:09
a json testing controller in CodeIgniter.
<?php
class Json_test extends Controller {
public function setter() {
$fp = fopen("/tmp/json_test.txt","w");
$content = json_encode($_POST);
fwrite($fp, $content, strlen($content));
fclose($fp);
echo $content;
}
@vejuhust
vejuhust / rdtsc.c
Created October 5, 2012 06:03
Read Time Stamp Counter from Intel x86 CPU
#include <stdio.h>
int main (int argc, const char * argv[]) {
unsigned int hi;
unsigned int lo;
long double result;
/* Set *hi and *lo to the high and low order bits of the cycle counter.
Implementation requires assembly code to use the rdtsc instruction. */
asm("rdtsc; movl %%edx,%0; movl %%eax,%1" /* Read cycle counter */
@vejuhust
vejuhust / jekyll-blog.md
Last active August 29, 2015 14:18
My Path to Blogging with Jekyll

Basic Setup

  • Pick up the theme
  • Fork the theme
  • Clean up Minimal Mistakes
  • Import Content via gitmodules
  • Main configuration
  • Homepage / index
  • About page
  • Navigation links
  • Replace header image