Skip to content

Instantly share code, notes, and snippets.

💀
thoughts$.scan(x => x * 2).share()

Adam Argyle argyleink

💀
thoughts$.scan(x => x * 2).share()
Block or report user

Report or block argyleink

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@argyleink
argyleink / css&js.css
Created Dec 26, 2018
css and js doing similar tasks
View css&js.css
foo {
color: hsl(100,80%,75%);
background-color: hsl(100,20%,25%);
}
foo.map(styles => ({
...styles,
color: 'hsl(100,80%,75%)',
background-color: 'hsl(100,20%,25%)',
}))
@argyleink
argyleink / immutables.js
Last active Jun 14, 2019
immutable array examples
View immutables.js
const clone = x => [...x]
const push = y => x => [...x, y]
const pop = x => x.slice(0,-1)
const unshift = y => x => [y, ...x]
const shift = x => x.slice(1)
const sort = f => x => [...x].sort(f)
const delete = i => x => [...x.slice(0,i), ...x.slice(i+1)]
const splice = (s,c,...y) => x => [...x.slice(0,s), ...y, ...x.slice(s+c)]
const unique = arr => [...new Set(arr)]
@argyleink
argyleink / custom.element.js
Last active Sep 8, 2018
custom element with shadow dom
View custom.element.js
export default class CustomElement extends HTMLElement {
constructor() {
super()
this.$shadow = this.attachShadow()
this.$shadow.innerHTML = this.render()
}
connectedCallback() {}
disconnectedCallback() {}
@argyleink
argyleink / tweak-sublime-theme-italics.md
Last active Oct 11, 2019 — forked from lavaldi/tweaks-sublime-italic-operator-mono.md
Operator Mono (or others) & any Sublime Text 3 theme cursive settings
View tweak-sublime-theme-italics.md
  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>
	<key>scope</key>
@argyleink
argyleink / ice-reveal.module.js
Last active May 7, 2018
simple, safe, compose-able, testable logic container
View ice-reveal.module.js
const module = (deps) => {
const actuallyPrivate = 'foo'
return Object.freeze({
interface
})
const interface = () =>
console.log(deps, actuallyPrivate)
}
@argyleink
argyleink / blingbling.js
Last active May 19, 2018 — forked from paulirish/bling.js
add some sugar to bling dot js
View blingbling.js
const sugar = {
on: function(names, fn) {
names
.split(' ')
.forEach(name =>
this.addEventListener(name, fn))
},
setAttributes: function(attrs) {
Object.entries(attrs)
.forEach(([key, val]) =>
@argyleink
argyleink / easings.css
Created Feb 26, 2018
Handy CSS properties for easing functions
View easings.css
:root {
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19);
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22);
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335);
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
View history.coffee
history = [
1999: 'VRML'
2000: 'HTML'
2000: 'CSS'
2000: 'JavaScript'
2000: 'XML'
2005: 'ActionScript2'
2007: 'Java'
2007: 'PHP'
2007: 'MySQL'
@argyleink
argyleink / likes.rxjs.ts.js
Created Jan 6, 2017
There an easier way? RXJS subject to increment likes on an array object
View likes.rxjs.ts.js
// this really what it takes to increment a counter on an item in my observable
// likes is a subject, broadcasting the updated array eventually to the source observable being rendered
this.likes
.map(
(message: Message): IMessagesOperation =>
(messages: Message[]) => {
return messages.map((m: Message) => {
// todo: check if user has already liked
if (m.id == message.id)
++m.likes
View easy_dom.js
const el = function(options) {
let node = document.createElement(options.type || 'div')
if (options.id) node.id = options.id
if (options.class) node.className = options.class
if (options.text) node.textContent = options.text
if (options.html) node.innerHTML = options.html
return node
}
You can’t perform that action at this time.