Skip to content

Instantly share code, notes, and snippets.

View leo424y's full-sized avatar

Fly Chang leo424y

View GitHub Profile
@leo424y
leo424y / gistpost
Created April 7, 2018 23:53 — forked from cverbiest/gistpost
gistpost
#!/bin/bash
# Purpose : post a file as github gist
# Author : Carl Verbiest
typeset local
script=$0
script_dir=${script%/*}
script=${script##*/}
@leo424y
leo424y / query.graphql
Created March 30, 2018 04:10 — forked from jonathansick/query.graphql
GitHub GraphQL repo commit history query
{
repository(name: "sickvim", owner: "jonathansick") {
ref(qualifiedName: "master") {
target {
... on Commit {
id
history(first: 5) {
pageInfo {
hasNextPage
}
live_loop :m do
sleep 1
end
live_loop :a do
sync :m
sample :ambi_dark_woosh
sleep 4
end
#Tomtom rhythms found on wikipedia https://en.wikipedia.org/wiki/Rhythm_in_Sub-Saharan_Africa#/media/File:Standard_pattern,_six_beats.png
#form the basis of this piece coded for Sonic PI by Robin Newman, December 2017
l1=(ring 1,0,1,0,1,0,1,0,1,0,1,0)
l2=(ring 0,1,0,1,0,1,0,1,0,1,0,1)
l3=(ring 0,1,0,0,1,1,0,1,0,1,0,1)
l4=(ring 1,0,1,0,1,1,0,1,0,1,0,1)
l=(ring l1,l2,l3,l4)
set :kill,0 #initialise kill flag
@leo424y
leo424y / README.md
Created February 15, 2018 08:36 — forked from xavriley/README.md
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

@leo424y
leo424y / sonic_pi_examples.txt
Created February 15, 2018 08:35 — forked from darinwilson/sonic_pi_examples.txt
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
@leo424y
leo424y / gitlfsserver.sh
Last active February 14, 2018 01:09 — forked from voidtuxic/gitlfsserver.sh
Git LFS server config
#!/bin/sh
### BEGIN INIT INFO
# Provides: gitlfsserver
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@leo424y
leo424y / pr.md
Last active October 20, 2016 04:58 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@leo424y
leo424y / bootstrapCDN.html
Created August 15, 2016 03:46 — forked from planetoftheweb/bootstrapCDN.html
Bootstrap 3 CDN Page Code
<!-- HEAD SECTION -->
<!-- IE Edge Meta Tag -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">