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
onServerStartup () { | |
const { serverId, ip } = getServerInfo() // serverId does not change across restarts | |
this.serverId = serverId | |
// We don't have any routers or producers (yet). Clear any value that exists in the DB related to our serverId | |
clearSharedDB(serverId, 'routers') | |
clearSharedDB(serverId, 'producers') | |
// Update the DB with our serverId and ip so that others will know how to reach us | |
registerServerInDB(serverId, ip) | |
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 fetchMachine = Machine({ | |
id: 'fetchMachine', | |
initial: 'idle', | |
context: { | |
isFetchedOnce: false, | |
isFetching: false, | |
data: null, | |
error: null, | |
}, | |
states: { |
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
" Convert new tabs to spaces | |
set expandtab | |
set shiftwidth=4 | |
set softtabstop=4 | |
set tabstop=4 | |
" No end of line | |
set noeol | |
call plug#begin() |
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 breakpoints = [ | |
'320px', | |
'640px', | |
'1024px', | |
'1280px', | |
'1680px', | |
]; | |
// @media screen and (min-width: 320px) | |
// @media screen and (min-width: 640px) | |
// @media screen and (min-width: 1024px) |
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 PropTypes from 'prop-types'; | |
import React from 'react'; | |
class Carousel extends React.Component { | |
static propTypes = { | |
limit: PropTypes.number, | |
total: PropTypes.number, | |
data: PropTypes.oneOfType([ | |
PropTypes.object, | |
PropTypes.array |
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 styled, { css } from 'styled-components'; | |
const Component = styled.div`${({ | |
width, | |
height, | |
before, | |
beforeBorderMask, | |
beforeBorderColor, | |
beforeBackgroundColor, |
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
require('babel-core/register'); | |
require('babel-polyfill'); | |
const timeout = (ms) => new Promise((resolve, reject) => { | |
setTimeout(() => reject(new Error(`Timeout exceeded: ${ms}ms`)), ms); | |
}); | |
class Player {} | |
class AsyncAction { |
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
# GRBL Source (The standard GRBL firmware is identaical to the Inventables GRBL, just some minor config changes.) | |
https://github.com/gnea/grbl | |
Compiled with settings: | |
[Changes to (config.h)] | |
#define DEFAULTS_X_CARVE_1000MM | |
#define HOMING_FORCE_SET_ORIGIN // Enabled | |
#define ENABLE_M7 // Enabled | |
#define ENABLE_SAFETY_DOOR_INPUT_PIN // Enabled |
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
// | |
// http://aqicn.org/air/view/sensor/spec/pms7003.pdf | |
// | |
const SerialPort = require('serialport'); | |
const port = new SerialPort('/dev/ttyUSB0', { | |
baudRate: 9600 | |
}); |
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
sudo nmap -sP 192.168.0.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}' |
NewerOlder