Skip to content

Instantly share code, notes, and snippets.

View argyleink's full-sized avatar
💀
calc(dev*design)

Adam Argyle argyleink

💀
calc(dev*design)
View GitHub Profile
@argyleink
argyleink / css-scrollbars.md
Created August 1, 2023 15:04 — forked from bramus/css-scrollbars.md
CSS Scrollbars

An issue we’ve heard from authors is that they want to know what scrollbars are doing and respond to that.

There’s a bunch of issues that might go hand in hand to actually solve this:

  1. [^1] Expose an env() variable that allows you to get the scrollbar-size. This is a fixed value, independent of whether a scrollbar is shown or not – it just gives you back the size
  2. [^2] A way to query which type of scrollbars are being used on the page.
  3. A container state query to be able to know if something is overflowing or not

If you combine these three, authors can do things like:

@argyleink
argyleink / tweak-sublime-theme-italics.md
Last active December 22, 2022 14:31 — forked from lavaldi/tweaks-sublime-italic-operator-mono.md
Operator Mono (or others) & any Sublime Text 3 theme cursive settings
  1. Install Package Resource Viewer.
  2. In package control window select ‘Package Resource Viewer: Open Resource’.
  3. Scroll down until you find the option: ‘Color Scheme — Default’ (or your theme with color scheme .tmTheme) and select it.
  4. Add the following to the end of the node to style selected (scope) syntax tokens cursive:
<dict>
	<key>name</key>
	<string>Mono Tweaks</string>
	scope
@argyleink
argyleink / blingbling.js
Last active May 19, 2018 01:04 — forked from paulirish/bling.js
add some sugar to bling dot js
const sugar = {
on: function(names, fn) {
names
.split(' ')
.forEach(name =>
this.addEventListener(name, fn))
},
setAttributes: function(attrs) {
Object.entries(attrs)
.forEach(([key, val]) =>

Booting Up A Development Server

Open a console. Terminal.app on Macs, your shell or whatever on PCs.

Python is easiest:

python -m SimpleHTTPServer 8000

Then go to http://localhost:8000/ in a web browser.

This is a small collection of scripts showing how to use require.js. It's only one of several ways of setting up a require.js project, but it's enough to get started.

At its core, require.js is about three things:

  1. Dependency management
  2. Modularity
  3. Dynamic script loading

The following files show how these are achieved.

function inferInputModel() {
if (window.navigator.msPointerEnabled) {
return 'pointer';
} else if (window.ontouchstart !== undefined) {
return 'touch';
} else {
return 'unknown';
}
}