- A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
- lengths are in any unit (ex: pixels)
- code snippets are in JavaScript
angleRad = angleDeg * Math.PI / 180;
| # Simple 16 step drum machine experiment with Node and CoffeeScript | |
| # by Peter Cooper - @peterc | |
| # | |
| # Inspired by Giles Bowkett's screencast at | |
| # http://gilesbowkett.blogspot.com/2012/02/making-music-with-javascript-is-easy.html | |
| # | |
| # Screencast demo of this code at http://www.youtube.com/watch?v=qWKkEaKL6DQ | |
| # | |
| # Required: | |
| # node, npm and coffee-script installed |
This is a ServiceWorker template to turn small github pages into offline ready app.
Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js files). I wanted to cache these files so that I can access my tools offline as well.
Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS of your repository.
| #!/bin/bash | |
| if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
| appify v3.0.1 for Mac OS X - http://mths.be/appify | |
| Creates the simplest possible Mac app from a shell script. | |
| Appify takes a shell script as its first argument: | |
| `basename "$0"` my-script.sh |
| * { | |
| font-size: 12pt; | |
| font-family: monospace; | |
| font-weight: normal; | |
| font-style: normal; | |
| text-decoration: none; | |
| color: black; | |
| cursor: default; | |
| } |
| <?php | |
| /* | |
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
These instructions will guide you through the process of setting up local, trusted websites on your own computer.
These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.
NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:
alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"| { | |
| "bold_folder_labels": true, | |
| "color_scheme": "Packages/User/Espresso Soda.tmTheme", | |
| "ensure_newline_at_eof_on_save": true, | |
| "file_exclude_patterns": | |
| [ | |
| ".DS_Store", | |
| ".gitkeep", | |
| "dump.rdb" | |
| ], |
| var scales = { | |
| 'natural major': [0,2,4,5,7,9,11,12], | |
| 'ionian': [0,2,4,5,7,9,11,12], | |
| 'major': [0,2,4,5,7,9,11,12], | |
| 'chromatic': [0,1,2,3,4,5,6,7,8,9,10,11,12], | |
| 'spanish 8 tone': [0,1,3,4,5,6,8,10,12], | |
| 'flamenco': [0,1,3,4,5,7,8,10,12], | |
| 'symmetrical': [0,1,3,4,6,7,9,10,12], | |
| 'inverted diminished': [0,1,3,4,6,7,9,10,12], | |
| 'diminished': [0,2,3,5,6,8,9,11,12], |
| # Filename-based cache busting | |
| # taken from https://github.com/h5bp/html5-boilerplate/ | |
| # This rewrites file names of the form `name.123456.js` to `name.js` | |
| # so that the browser doesn't use the cached version when you have | |
| # updated (but not manually renamed) the file. | |
| <IfModule mod_rewrite.c> | |
| Options +FollowSymlinks | |
| RewriteEngine On |