Skip to content

Instantly share code, notes, and snippets.

View leetheguy's full-sized avatar

Lee Nathan leetheguy

View GitHub Profile

Screen width based styles can be applied to most classes. They are

-ns (not small > 48em)

-m (medium >48em <64em)

-l (large >64em).

Tachyons is mobile-first and small is left out as it's the default.

import { Component, State, Listen } from '@stencil/core';
@Component({
tag: 'analog-clock',
})
export class AnalogClock {
timer: number;
@State() time: number = Date.now();
@State() timeZone: number = 0;
import { Component, Prop, Event, EventEmitter } from '@stencil/core';
import '@ionic/core';
@Component({
tag: 'time-zone-slider'
})
export class TimeZoneSlider {
@Prop() offset: number;
@Event() timeZoneChanged: EventEmitter;
import { Component } from '@stencil/core';
@Component({
tag: 'analog-clock',
})
export class AnalogClock {
render() {
return [
<div>
<clock-face/>
import { Component, State } from '@stencil/core';
@Component({
tag: 'analog-clock',
})
export class AnalogClock {
timer: number;
@State() time: number = Date.now();
import { Component } from '@stencil/core';
@Component({
tag: 'analog-clock',
})
export class AnalogClock {
get hour(): number {
let h: any = new Date().getHours();
return h;
}
import { Component, Prop } from '@stencil/core';
@Component({
tag: 'clock-face'
})
export class ClockFace {
@Prop() hour: number;
@Prop() minute: number;
@Prop() second: number;
import { Component } from '@stencil/core';
@Component({
tag: 'clock-face'
})
export class ClockFace {
render() {
return (
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
@leetheguy
leetheguy / cities.json
Created December 24, 2017 17:27 — forked from Miserlou/cities.json
1000 Largest US Cities By Population With Geographic Coordinates, in JSON
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
[10:26:59] typescript: node_modules/@types/pouchdb-core/index.d.ts, line: 796
',' expected.
L797: //
[10:26:59] typescript: node_modules/@types/pouchdb-core/index.d.ts, line: 799
',' expected.
L798: declare module 'pouchdb-core' {
L799: const PouchDb: PouchDB.Static;