Skip to content

Instantly share code, notes, and snippets.

View dingzeyuli's full-sized avatar

Dingzeyu Li dingzeyuli

View GitHub Profile
@dingzeyuli
dingzeyuli / README.md
Created June 29, 2019 04:49 — forked from asimshankar/README.md
Training TensorFlow models in C++

Training TensorFlow models in C++

Python is the primary language in which TensorFlow models are typically developed and trained. TensorFlow does have bindings for other programming languages. These bindings have the low-level primitives that are required to build a more complete API, however, lack much of the higher-level API richness of the Python bindings, particularly for defining the model structure.

This file demonstrates taking a model (a TensorFlow graph) created by a Python program and running the training loop in C++.

@dingzeyuli
dingzeyuli / README.md
Last active June 29, 2019 04:49 — forked from asimshankar/README.md
Training TensorFlow models in C

Training TensorFlow models in C

Python is the primary language in which TensorFlow models are typically developed and trained. TensorFlow does have bindings for other programming languages. These bindings have the low-level primitives that are required to build a more complete API, however, lack much of the higher-level API richness of the Python bindings, particularly for defining the model structure.

This gist demonstrates taking a model (a TensorFlow graph) created by a Python program and running the training loop in a C program.

The model

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

mv "$1" "$1".ori.pdf
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/prepress -sOutputFile="$1" "$1".ori.pdf
# the PDFSETTINGS can be set to following values for different compression ratio.
# largest printer / prepress
# mid-size ebook
# smallest screen
@dingzeyuli
dingzeyuli / CoreTemp.sh
Last active September 27, 2017 14:23
get all the core temperature
cat /sys/devices/platform/coretemp.?/hwmon*/hwmon*/temp*_input
cat /sys/devices/platform/coretemp.?/hwmon*/hwmon*/temp*_input | awk '{ total += $1 } END { print total/NR/1000 }'
@dingzeyuli
dingzeyuli / install.sh
Last active June 19, 2017 17:24 — forked from kilfu0701/install.sh
Install PyQt5 with Python2.7 on Mac
cd ~
mkdir dev_tools
cd dev_tools
## download SIP source code
wget http://sourceforge.net/projects/pyqt/files/sip/sip-4.16.7/sip-4.16.7.tar.gz
tar zxf sip-4.16.7.tar.gz
cd sip-4.16.7
python configure.py
make
@dingzeyuli
dingzeyuli / DeleteGmusicDupes-Python35.py
Created April 16, 2017 23:05 — forked from TKIPisalegacycipher/DeleteGmusicDupes-Python35.py
Python script to find and delete duplicate tracks from Google Play Music library.
#!/usr/bin/env python
# created by shuichinet https://gist.github.com/shuichinet
# forked from https://gist.github.com/shuichinet/8159878 21 Nov 2015
# using minor edits by fcrimins https://www.reddit.com/user/fcrimins from https://www.reddit.com/r/google/comments/2xzgyv/remove_duplicate_songs_from_google_play_music/csh6mrh
# also using clever edits by Morgan Gothard https://medium.com/@mgothard
# updated for Python 3.5 by John M. Kuchta https://medium.com/@sebvance 22 Nov 2016 (hey I was busy)
# compiled by John M. Kuchta https://medium.com/@sebvance
# thanks to shuichinet, fcrimins and Mr. Gothard for their work
@dingzeyuli
dingzeyuli / fix_mac_camera.sh
Created April 12, 2017 17:41
This script fixes Macbook's and iMac's Facetime Camera.
#!/bin/bash
sudo killall VDCAssistant
sudo killall AppleCameraAssistant
@dingzeyuli
dingzeyuli / check_github_repo_size
Created December 16, 2016 22:34
Check the size of a github repo before downloading
# http://webapps.stackexchange.com/questions/39587/view-estimated-size-of-github-repository-before-cloning
# tested on macOS
echo https://github.com/torvalds/linux.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -I{} curl -s -k https://api.github.com/repos/'{}' | grep size
# output:
# "size": 1746294,
@dingzeyuli
dingzeyuli / copy
Created November 11, 2016 15:33
Faster and more efficient alternative to scp for file copying
#!/bin/sh
# whenever you use "scp", use "copy" instead, it ignores duplicate files.
rsync -azhe ssh --progress $1 $2