Skip to content

Instantly share code, notes, and snippets.

View codescv's full-sized avatar
🎯
Focusing

Chi Zhang codescv

🎯
Focusing
View GitHub Profile
@codescv
codescv / sort.c
Created August 7, 2013 08:22
remainder
// GistID: 6172227
#include <stdio.h>
#include <stdlib.h>
struct node_t {
struct node_t *next;
int val;
};
typedef struct node_t node;
@codescv
codescv / gist:6146378
Created August 3, 2013 13:04
bit vector (aka bitmap) implementation in C
#include <stdio.h>
typedef struct {
char* bits;
int size;
}bitvector;
bitvector* create_bitvec(int n_bits) {
bitvector* vec = (bitvector*)malloc(sizeof(bitvector));
int size = sizeof(bitvector) * ceil(n_bits/8.0);
@codescv
codescv / .bashrc
Created January 11, 2013 14:44
.bashrc
# GistID: 4511178
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# base-files version 4.1-1
@codescv
codescv / .zshrc
Created November 10, 2012 14:20
zshrc
# GistID: 4051243
# The prompt
# enable color support of ls and also add handy aliases
setopt prompt_subst
autoload -U colors
colors
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'