Skip to content

Instantly share code, notes, and snippets.

View luwes's full-sized avatar
🙇‍♂️

Wesley Luyten luwes

🙇‍♂️
View GitHub Profile
/*
! tailwindcss v3.2.4 | MIT License | https://tailwindcss.com
*/
/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/
*,
<style>
:host {
--_primary-color: var(--media-primary-color, rgb(255 255 255 / .9));
--_secondary-color: var(--media-secondary-color, rgb(0 0 0 / .75));
--_volume-range-expand-width: 70px;
--_volume-range-expand-height: 42px;
--media-icon-color: var(--_primary-color);
--media-range-thumb-background: var(--_primary-color);
--media-range-bar-color: var(--_primary-color);
@luwes
luwes / layout.html
Created February 25, 2023 23:01
Example remote layout.html for template-extends
<template block="head">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css" />
</template>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<main>
<header>
header
@luwes
luwes / cloudSettings
Last active December 19, 2019 22:43
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-12-19T22:38:50.273Z","extensionVersion":"v3.4.3"}

Keybase proof

I hereby claim:

  • I am luwes on github.
  • I am luwes (https://keybase.io/luwes) on keybase.
  • I have a public key ASDE6Oaedhz1Ud4ltpbKU0z19dFw1ubiJRxvsg_xqs4nsQo

To claim this, I am signing this object:

@luwes
luwes / tagref.js
Created March 24, 2019 01:00
Static variable tag names for lit-html, lighterhtml, etc...
import { html } from 'lit-html';
const superhtml = tagRef(html)
const result = superhtml`<${MyComponent}>Woohoo</${MyComponent}>`;
export function tagRef(html) {
const cache = new WeakMap();
return (s, ...e) => {
const tagIndex = (t, i) =>
// checks for '*<' or '*</' and a valid tagname
/* eslint-env node */
const fs = require('fs');
const path = require('path');
const camelCase = require('lodash/camelcase');
const pkg = require(path.resolve('package.json'));
const defaultOptions = {
regex: /^rollup-plugin-/,
path: './'
};
@luwes
luwes / redux-proxy-selectors.js
Created December 26, 2017 04:59
Experiment to add selectors to state as getters
/**
The selectors would be a map e.g.
const selectors = {
ui: {
getDoubleBurgers: (state) => state.ui.burger + state.ui.burger
}
}
@luwes
luwes / rollup.js
Created September 7, 2017 00:58
Rollup library script - JavaScript API
/* eslint-env node */
const fs = require('fs');
const uglifyJs = require('uglify-js');
const chalk = require('chalk');
const maxmin = require('maxmin');
const rollup = require('rollup');
const babelrc = require('babelrc-rollup').default;
const babel = require('rollup-plugin-babel');
const nodeResolve = require('rollup-plugin-node-resolve');
@luwes
luwes / main.py
Last active September 27, 2016 18:26
Tornado Vimeo Mixin OAuth2
class BaseHandler(RequestHandler):
COOKIE_NAME = 'user'
def get_current_user(self):
user_json = self.get_secure_cookie(self.COOKIE_NAME)
if not user_json:
return None
return json_decode(user_json)
class LoginHandler(BaseHandler, VimeoMixin):