Skip to content

Instantly share code, notes, and snippets.

View icaruszhu's full-sized avatar

Chen W. Zhu icaruszhu

View GitHub Profile
@dmkitchen
dmkitchen / little-fugue.rb
Last active December 28, 2023 15:33
Bach's little fugue in G minor transcribed to Sonic Pi
#XVIII FUGE. G-moll.
#Programmed by Static Method https://static-method.com/
# updates available here:
# https://gist.github.com/dmkitchen/52dcc366f71e5a59d1e36cb53c677555
use_bpm 80
FULL_STEP = 2
HALF_STEP = 1
WHOLE_NOTE = 4

Add ” ‘ ” (left single quotation mark) to the variable “typo-cycle-single-right-sign-quotation-mark” (thanks to https://github.com/jorgenschaefer/typoel)

I have the below code in my emacs config file:

(use-package typo
  :defer t
  :delight ""
  :config
@icaruszhu
icaruszhu / pandoc-batch-convert-docx-pdf-YALA.org
Last active January 19, 2021 18:16
Pandoc batch convert assignment docx to

I need to convert students’ assignments submitted in .docx into pdf files. After downloading the assignment WORD files from Canvas-LMS, I use pandoc to convert them into PDF in the terminal.

I use a for loop to iterate through each assignment, which will also be numbered in order.

Here is the one-line shell cammand code written by me:

n=0 && for assignment in *.docx; do let "n=n+1" &&  echo  $n\.\.\.$assignment" [IS BEING CONVERTED…PLZ WAIT…]"  && pandoc -s $assignment -o $n-$assignment.pdf --pdf-engine=xelatex -V mainfont:"DejaVu Serif"; done
WARNING: Logging before flag parsing goes to stderr.
W0730 21:03:55.281007 139779186857856 deprecation_wrapper.py:119] From /content/drive/My Drive/ml/2019-07-30/gpt-2-elisp-untab/src/model.py:147: The name tf.AUTO_REUSE is deprecated. Please use tf.compat.v1.AUTO_REUSE instead.
W0730 21:03:57.490804 139779186857856 deprecation_wrapper.py:119] From /content/drive/My Drive/ml/2019-07-30/gpt-2-elisp-untab/src/memory_saving_gradients.py:13: The name tf.GraphKeys is deprecated. Please use tf.compat.v1.GraphKeys instead.
W0730 21:04:02.302061 139779186857856 deprecation_wrapper.py:119] From ./train.py:87: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.
W0730 21:04:02.302422 139779186857856 deprecation_wrapper.py:119] From ./train.py:90: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.
2019-07-30 21:04:02.319198: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2200000000 Hz
@sachac
sachac / cooking.org
Created May 2, 2017 04:46
Org Mode cooking notes, with some code for compiling a grocery list and comparing it with staples

Meal planning tool

@darinwilson
darinwilson / sonic_pi_examples.txt
Last active March 15, 2024 14:59
Sonic Pi Examples
##############################################
## Example 1 - play a note
play 60
##############################################
## Example 2 - play 4 random notes
4.times do
play rrand_i(60, 90)
sleep 0.5
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xavriley
xavriley / README.md
Last active December 30, 2023 12:17
Original NES Mario Theme for Sonic Pi

Making Chiptune Music using Sonic Pi v2.0

Warning: this might not work on a RaspberryPi yet

I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.

I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!

Getting the sounds of the NES chip