<div data-module="/ui/component.js"
data-context="@media (min-width:30em) and was @visible">
</div>
- src
- main.js
- ui
- foo.js
- bar.js
This command generates modules where identifiers have been set to absolute module paths:
browserify ./src/**/*.js -o ./dist/bundle.js --full-paths
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arrow = (str, i) => str[i] === '-' && str[i+1] === '>'; | |
const string = (c) => c === "'" || c === '"'; | |
const comma = (c) => c === ','; | |
const opener = (c) => c === '('; | |
const closer = (c) => c === ')'; |
Assumption: Next button is most clicked button in a pagination control.
The trap is to layout the HTML to match the design of the control. With the next button last and the previous button first.
By reformatting the HTML we can make things easier for everyone:
- Visual users still see the classic paging (CSS takes care of that);
- Tab focus for keyboard users is immidiately brought to next button, no need to tab over all pages;
- Screenreader users have the same benefit and also hear which page is currently active;
Any suggestions on what more we could improve?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var animate = (function(){ | |
'use strict'; | |
var PI = Math.PI; | |
var PI_HALF = Math.PI/2; | |
var deltas = { | |
linear:function(p) {return p;}, | |
easeInSine:function(p) {return Math.cos(p * PI_HALF);}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Default button style | |
StyleCollection.addStyle("btn-default", paint: {(view) -> Void in | |
// These buttons should all have rounded corners and a dropshadow | |
view.layer.cornerRadius = view.frame.height * 0.5 | |
view.layer.backgroundColor = UIColor(hex:0x294A5F).CGColor | |
view.layer.shadowColor = UIColor.blackColor().CGColor | |
view.layer.shadowOffset = CGSizeMake(0, 2) | |
view.layer.shadowRadius = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIView { | |
func hide() { | |
hidden = true | |
} | |
func show() { | |
hidden = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# "Usernoted" seems to be the "user notifications daemon", so get it's PID. | |
pid=$(ps aux | grep -i [u]sernoted | awk '{print $2}') | |
# Find the sqlite3 database that this program has open. It's in a "private" folder (app sandboxing). | |
db="$(lsof -p $pid | grep com.apple.notificationcenter/db/db\$ | awk '{print $9}')" | |
# I got the bundleid from Spotify.app/Contents/Info.plist | |
bundleid="com.spotify.client" | |
# I use 0 as the flags because you can change all the settings in System Preferences |
I hereby claim:
- I am rikschennink on github.
- I am rikschennink (https://keybase.io/rikschennink) on keybase.
- I have a public key whose fingerprint is 679B 6933 62E6 CD78 C5A4 3DE9 3FB0 0B55 E5D3 8AEE
To claim this, I am signing this object: