Skip to content

Instantly share code, notes, and snippets.

View junzhengca's full-sized avatar
🥼
ummm.... weird....

Jun junzhengca

🥼
ummm.... weird....
View GitHub Profile
@junzhengca
junzhengca / bool.py
Last active February 16, 2017 17:19
Simple Boolean Check in Python
def isTrue(cond):
toCheck = str(cond)
trueStr = "True"
currIndex = 0
if len(toCheck) != len(trueStr):
return False
for c in toCheck:
if c != trueStr[currIndex]:
return False
currIndex += 1
@junzhengca
junzhengca / hash.c
Created February 13, 2017 16:55
Hashtable in C
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
struct entry_s {
char *key;
char *value;
@junzhengca
junzhengca / reset.css
Created February 6, 2017 12:11
Reset browser css
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
@junzhengca
junzhengca / rsa.html
Last active November 22, 2024 21:41
简单的Js RSA加密
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>RSA Test</title>
<script src="http://peterolson.github.com/BigInteger.js/BigInteger.min.js"></script>
</head>
<body>
<script>
// Copyright Jun Zheng / 版权所有 Jun Zheng
@junzhengca
junzhengca / compsci-tut-intro.html
Last active November 28, 2016 14:10
Code for posting new videos.
<img class="alignnone size-full wp-image-28" src="http://whatscodecn.me/wp-content/uploads/2016/11/cover-1.png" alt="cover" width="884" height="499" />
计算机科学教室入门篇,第二课。
input(),变量,Memory Model,Debug
Bilibili:<a href="http://www.bilibili.com/video/av7191464/">http://www.bilibili.com/video/av7191464/</a>
这次的练习:
<ul>
@junzhengca
junzhengca / template.tex
Last active November 18, 2016 20:09
LaTeX PDF File Template, I use this for University of Toronto assignments and exercises.
\documentclass{article}
\usepackage{fullpage}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{hyperref}
\usepackage{fancyhdr}
@junzhengca
junzhengca / README.md
Last active May 22, 2016 16:48
Processing 倒计时器

简单的Processing倒计时器,在Mac OSX 10.11.5 和 Processing 3.0.1环境下测试可用,不过目测什么系统都可以用就是了= =

@junzhengca
junzhengca / doc.md
Last active October 18, 2015 19:42
A JavaScript class that displays info blocks on your website

How to use

<div class="index-panel-pic-post-container" id="index-panel-pic-post-container">
  <div id="index-panel-pic-post-container-scrollable">
    <div class="index-panel-pic-post-container-block"></div>
    <div class="index-panel-pic-post-container-block"></div>
    <div class="index-panel-pic-post-container-block"></div>
    <div class="index-panel-pic-post-container-block"></div>
    <div class="index-panel-pic-post-container-block"></div>
    <div class="index-panel-pic-post-container-block"></div>
@junzhengca
junzhengca / main.py
Last active October 14, 2015 16:35
WMCI CompSci 20 - 如何在Python中读取文件,并随机输出单词,使用Python的random库
#Copyright Jun Zheng All Rights Reserved, this gist is licenced under Creative Common Attribute International
#Jun Zheng 版权所有,保留所有权利 此Gist使用Creative Common Attribute International授权
import random
f = string.join(open("word.list").readlines()).split()
print(random.choice(f))
@junzhengca
junzhengca / spirte.scratch
Created September 13, 2015 18:52
scratch gravity & jump example
when greenflag clicked
set jumping to 0
set jumpFrame to 1
set jMultiplier to 20
set gMultiplier to 2
delete all of boxCollision
add 50 to boxCollision
add 40 to boxCollision
forever
calcGrav