Skip to content

Instantly share code, notes, and snippets.

Avatar

Dingzeyu Li dingzeyuli

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

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 Jun 29, 2019 — forked from asimshankar/README.md
Training TensorFlow models in C
View README.md

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

View what-i-wish-id-known-about-equity-before-joining-a-unicorn.md

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

View compress.sh
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 Sep 27, 2017
get all the core temperature
View CoreTemp.sh
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 Jun 19, 2017 — forked from kilfu0701/install.sh
Install PyQt5 with Python2.7 on Mac
View install.sh
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 Apr 16, 2017 — forked from TKIPisalegacycipher/DeleteGmusicDupes-Python35.py
Python script to find and delete duplicate tracks from Google Play Music library.
View DeleteGmusicDupes-Python35.py
#!/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 Apr 12, 2017
This script fixes Macbook's and iMac's Facetime Camera.
View fix_mac_camera.sh
#!/bin/bash
sudo killall VDCAssistant
sudo killall AppleCameraAssistant
@dingzeyuli
dingzeyuli / check_github_repo_size
Created Dec 16, 2016
Check the size of a github repo before downloading
View check_github_repo_size
# 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 Nov 11, 2016
Faster and more efficient alternative to scp for file copying
View copy
#!/bin/sh
# whenever you use "scp", use "copy" instead, it ignores duplicate files.
rsync -azhe ssh --progress $1 $2