Skip to content

Instantly share code, notes, and snippets.

View JesseEisen's full-sized avatar
🎯
Focusing

LinKang Chen JesseEisen

🎯
Focusing
View GitHub Profile
@JesseEisen
JesseEisen / Review Viewer
Created September 12, 2014 06:00
This is my owner tools,use to review my note easily. without to view in floder.just click. Support save the modify.
from Tkinter import *
from tkMessageBox import *
from FileDialog import *
import os
root=Tk()
root.title('Reviewer')
root.geometry('900x600')
#this is a function to get file list
@JesseEisen
JesseEisen / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@JesseEisen
JesseEisen / byteboder
Created September 21, 2014 12:14
This is a snippet to test a OS use which endian.
#include<stdio.h>
int main(int argc, char *argv[])
{
union
{
short s;
char c[sizeof(short)];
}un;
@JesseEisen
JesseEisen / countline
Created September 23, 2014 12:25
my personal tool to count source file lines. This is Shell version
#!/bin/bash
# write to count the sourcefile
w=0
par=$3
origin=2
echo "${par:=$origin}"
for s in $(find $1 -maxdepth ${par:=$origin} -type f -name "*.$2")
@JesseEisen
JesseEisen / Countline
Created September 23, 2014 12:26
Countline program, written by C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <dirent.h> /*some functions option on dir*/
#include <sys/stat.h>
@JesseEisen
JesseEisen / Linklist.c
Created October 9, 2014 07:06
A easy way to contruct a linklist and some base options. written by C
@JesseEisen
JesseEisen / sort_search.c
Created October 14, 2014 08:39
some sort function snippets
//easy way
void quicksort(int v[], int n)
{
int i, last;
if(n <= 1)
return;
swap(v,0, rand()%n);
last = 0;
e.g. man -t bash | ps2pdf - bash.pdf
But sometimes ps2pdf may encounter an error, the reson is that '-' is not a filename, that's so weird. And i use the following
command to fix this error
e.g. man -t bash > temp
ps2pdf temp bash.pdf
It's temperaly way to solve this problem.
@JesseEisen
JesseEisen / parser.awk
Created November 7, 2015 09:05
Use awk to parse a expression
#!/bin/awk
# input: a:=10
# output: the value is 10
BEGIN{ PrintRes() }
function parse() {
if(tok == "(eof)") return "(eof)"
while(length(line) == 0)
if(getline line == 0)
@JesseEisen
JesseEisen / mytail.c
Created June 15, 2016 13:54
'tail -n' implemented by C
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define DEFLINES 10
#define MAXLEN 100
int getlines(char *s, int len){
int c, i;