Skip to content

Instantly share code, notes, and snippets.

View jeremy886's full-sized avatar
🌴
moving to a country town

Jeremy Chen jeremy886

🌴
moving to a country town
  • Hamilton, VIC, Australia
View GitHub Profile
@jeremy886
jeremy886 / python3.7-es6-comparison.md
Last active June 28, 2018 04:41 — forked from revolunet/python-es6-comparison.md
# Python3.6 VS ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 3.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@jeremy886
jeremy886 / gist:89cd76e9c1a228f0601502dcba53c5dd
Created November 19, 2017 21:37 — forked from speric/gist:6096965
vimtutor Lesson Summaries
Lesson 1 SUMMARY
1. The cursor is moved using either the arrow keys or the hjkl keys.
h (left) j (down) k (up) l (right)
2. To start Vim from the shell prompt type: vim FILENAME <ENTER>
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
OR type: <ESC> :wq <ENTER> to save the changes.
@jeremy886
jeremy886 / dz[1].mathjax
Created August 27, 2017 05:46
deep learning equation
\begin{align*}
\frac{dL}{dz^{[1]}} = & \frac{dL}{da^{[1]}} \times \frac{da^{[1]}}{dz^{[1]}} \\
& = \frac{dz^{[2]}}{da^{[1]}} \frac{dL}{dz^{[2]}} \times \frac{da^{[1]}}{dz^{[1]}} \\
& = \frac{d(W^{[2]}{^T}a^{[1]})}{d a^{[1]}} {\bf dz^{[2]}} \times \frac{da^{[1]}}{dz^{[1]}} \\
& = W^{[2]}{^T} {\bf dz^{[2]}} \times \frac{da^{[1]}}{dz^{[1]}} \\
& = \frac{W^{[2]}{^T}}{dz^{[2]}} \times \frac{d}{dz^{[1]}}g^{[1]}(z^{[1]}) \\
@jeremy886
jeremy886 / p5js_test.html
Last active October 10, 2020 01:47
Brython p5.js test
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/p5@1.1.9/lib/p5.js"></script>
<script type="text/javascript"
src="https://cdn.rawgit.com/brython-dev/brython/master/www/src/brython.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/brython/3.8.10/brython.min.js" integrity="sha512-vaUMOYK2BF2hTTOXyvh7IoMaY6dDi7WkcywhsyX7XmASXxyZITWmsNK08VVQQwLrcsyGVXsypUNL/rbCeCpyLw==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/brython/3.8.10/brython_stdlib.min.js" integrity="sha512-CRKDjWdmHDkAJF/3fn4TFNRQkMybzRW41h92BUXM/n4bRMkOpfoO9t7saEw7BN/JstEu9LmYn0tTku+wY6jixw==" crossorigin="anonymous"></script>
@jeremy886
jeremy886 / draw_text.py
Created June 3, 2017 07:40
draw chinese text using true type font
from PIL import (
Image,
ImageDraw,
ImageFont,
)
#SIZE = (100, 100)
base = Image.open('images/lena.png').convert('RGBA')
text = Image.new('RGBA', base.size, (255, 255, 255, 0))
# Chinese Fonts
def num_buses(n):
""" (int) -> int
Precondition: n >= 0
Return the minimum number of buses required to transport n people.
Each bus can hold 50 people.
>>> num_buses(75)
2
__author__ = 'Jeremy Chen'
def merge_sort(unsorted):
sorted_ = []
length = len(unsorted)
if length == 1:
sorted_ = unsorted
@jeremy886
jeremy886 / jupyter_shortcuts.md
Created December 28, 2016 01:54 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command