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
<script type="ts"> | |
import onClickOutside from '../clickOutside' | |
</script> | |
<div use:onClickOutside={() => console.log('click')}> | |
modal | |
</div> |
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
<script> | |
import MyButton from './button.svelte' | |
</script> | |
<div> | |
<MyButton /> | |
<MyButton /> | |
<MyButton /> | |
<MyButton /> | |
</div> |
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 { Emitter } from 'events' | |
import React from 'react' | |
function createInstance() { | |
const globalAppState = { | |
foo: 'bar', | |
spam: 'eggs' | |
} |
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
###-begin-npm-completion-### | |
# | |
# npm command completion script | |
# | |
# Installation: npm completion >> ~/.bashrc (or ~/.zshrc) | |
# Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm | |
# | |
if type complete &>/dev/null; then | |
_npm_completion () { |
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
[ | |
{ | |
"dataSource": "derived:com.google.calories.expended:com.google.android.gms:from_activities", | |
"entries": [ | |
{ | |
"start": "2020-02-04T08:00:00+01:00", | |
"end": "2020-02-04T08:10:00+01:00", | |
"value": 12.833333333333332 | |
}, | |
{ |
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 React from 'react' | |
import ReactDOM from 'react-dom'; | |
import LaunchpadRenderer from './renderer' | |
import { Mock } from 'lunchpad' | |
import Shim from './shim/App'; | |
import Wild from './examples/Wild' // random colors | |
import GoL from './examples/gol/Gol' // game of life: set the initial population via buttons, start with the red button |
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 * as moment from 'moment'; | |
import * as ms from 'ms'; | |
function alignToInterval(time: moment.Moment, interval: string): moment.Moment { | |
const intervalMS = ms(interval); | |
const slot = Math.floor((time.unix() * 1000) / intervalMS) * intervalMS; | |
return moment.utc(slot); | |
} |
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 hirestime = require('hirestime'); | |
const Redis = require('ioredis'); | |
const stats = require('stats-lite'); | |
const client = new Redis('redis://redis:6379'); | |
const MAX_CARDINALITY = 1e6; | |
const times = []; | |
const timesGet = []; |
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
<html> | |
<head> | |
<script> | |
class Service { | |
inProgress = null; | |
async uploadData() { | |
if (!this.inProgress) { | |
console.log('ohay, I\'m actually doing a request'); |
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
function getGOL(size) { | |
return function(matrix) { | |
const result = []; | |
for (let x = 0; x < matrix.length; x++) { | |
result[x] = []; | |
for (let y = 0; y < matrix.length; y++) { | |
const count = countNeighbours(matrix, x, y); |
NewerOlder