Skip to content

Instantly share code, notes, and snippets.

View dan-zheng's full-sized avatar
🥛
우유맛

Dan Zheng dan-zheng

🥛
우유맛
View GitHub Profile
@dan-zheng
dan-zheng / gh-pages-deploy.md
Created May 14, 2016 14:39 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@dan-zheng
dan-zheng / notepad.html
Created April 27, 2016 14:22 — forked from jdkanani/notepad.html
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
@dan-zheng
dan-zheng / exact_fractional_answer.problem
Created January 13, 2016 13:56
LonCAPA exact fractional answer example
<problem>
<part id="1">
<startouttext />
<span style="font-size:20px;"><b>(b)</b>
Test question: please input the fraction "2/3". <font color="crimson">Enter exact answers only, no approximations.</font>
<br></br>
</span>
<endouttext />
<formularesponse answer="2/3">
import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
import tensorflow as tf
x = tf.placeholder("float", [None, 784])
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
y = tf.nn.softmax(tf.matmul(x, W) + b)
y_ = tf.placeholder("float", [None, 10])
@dan-zheng
dan-zheng / pickWord.py
Last active September 27, 2020 21:19 — forked from ed-flanagan/LICENSE
Oren Tirosh’s mnemonic word list
#!usr/bin/env python
import random
def main():
wordFile = open("wordList.txt", "r")
words = wordFile.readlines()[2:]
wordFile.close()
print(random.choice(words).rstrip())