Skip to content

Instantly share code, notes, and snippets.

View Arkham's full-sized avatar
🏠
Working from home

Ju Liu Arkham

🏠
Working from home
View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
queryParams: [
{ perPage: 'per_page'}
]
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="style.css" rel="stylesheet">
<title>Critical Path</title>
</head>
<body>
<p>Hello <span>web performance</span> students!</p>
<div><img src="http://i.imgur.com/CPOmUCv.jpg"></div>
</body>
body { font-size: 18px }
p { font-weight: bold }
span { color: red }
p span { display: none }
img { float: right }
<link href="style.css" rel="stylesheet">
<link href="mobile.css" rel="stylesheet" media="(max-device-width: 480px)">
<link href="style.css" rel="stylesheet">
<link href="print.css" rel="stylesheet" media="print">
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="style.css" rel="stylesheet">
<title>Critical Path: Script</title>
</head>
<body>
<p>
Hello
<script>document.write("<span>Amazing</span>");</script>
@Arkham
Arkham / fun.rb
Last active September 20, 2023 20:40
Fun with Ruby and a Raspberry PI
require 'pi_piper'
require 'ostruct'
laser = PiPiper::Pin.new(pin: 17, direction: :out)
alarm = PiPiper::Pin.new(pin: 18, direction: :out)
vibration = PiPiper::Pin.new(pin: 27, direction: :in)
i2c = PiPiper::I2C.new
def turn_on(pin)
pin.off
@Arkham
Arkham / nokring-player.rb
Last active November 15, 2016 23:36
Nokia Ringtone Player for Sonic PI
use_bpm 140
song = "4a1 4#a1 8g1 8#a1 8c2 8f1 8a1 4#a1 8g1 8#a1 8d2 4#d2 8d2
8c2 4#a1 8g1 8#a1 8c2 8f1 8a1 4#a1 8g1 8#a1 8d2 4#d2 8d2 8c2 4#a1 8g1 8#a1 8c2
8f1 8a1 4#a1 8g1 8#a1 8d2 4#d2 8d2 8c2 4#a1 8g1 8#a1 8a1 8f1 8f1 2g1"
class NokringParser
DURATION_REGEX = /(?<duration>1|2|4|8|16|32)?(?<dotted>\.)?/
NOTE_REGEX = /^#{DURATION_REGEX}(?<sharp>\#)?(?<note>[cdefgab])(?<octave>[1234])?$/
PAUSE_REGEX = /^#{DURATION_REGEX}\-$/x