Skip to content

Instantly share code, notes, and snippets.

select "sequence".id + 1 as start, min(fr.id) - 1 as stop
from "sequence"
left outer join sequence as r on "sequence".id = r.id - 1
left outer join sequence as fr on "sequence".id < fr.id
where r.id is null and fr.id is not null
group by "sequence".id, r.id;

Staying safe in chaotic times — A message from our founders

As you may have heard or seen by now, the novel coronavirus is greatly affecting the world around us. Our markets, our work lives, our social lives, and perish the thought — our loved ones.

It would be irresponsible to not acknowledge this. With that in mind, we’d like to spend this week by sharing useful images, content, and recommendations to stay safe in trying times.

This is a wonderfully lucid piece on how we can help curb/slow the virus growth. The primary concept in this article is Social Distancing.

Social distancing is a term applied to certain actions that are taken by Public Health officials to stop or slow down the spread of a highly contagious disease.

For today's lesson, we're going to learn how to build a simple node js API!

API's are the backbone of building any app. It's how you can connect to a database, how you can accept payments, and how you can serve data to any application

A few prerequisites:

  • Basic knowledge of terminal commands
  • node installed
  • yarn or npm installed
@shortcircuit3
shortcircuit3 / wod.js
Created June 14, 2018 21:22
the most basic mvp for wod
const workouts = ['20 pushups', '50 squats, 20 jumping jacks', 'Run one mile']
const randomNumber = Math.floor(Math.random() * workouts.length)
const randomWorkout = workouts[randomNumber];
console.log(randomWorkout)
2018-04-25T16:03:06.184369+00:00 app[web.1]: info: [runner] - Commenting, with results:
2018-04-25T16:03:06.184381+00:00 app[web.1]: mds: 0
2018-04-25T16:03:06.184383+00:00 app[web.1]: messages: 2
2018-04-25T16:03:06.184385+00:00 app[web.1]: warns: 0
2018-04-25T16:03:06.184387+00:00 app[web.1]: fails: 1
2018-04-25T16:03:06.184388+00:00 app[web.1]:
2018-04-25T16:03:06.234726+00:00 app[web.1]: Failing the build, there is 1 fail.
2018-04-25T16:03:06.264692+00:00 app[web.1]: error: Error: TypeError: this.platform.getInlineComments is not a function
2018-04-25T16:03:06.264698+00:00 app[web.1]: at Executor.<anonymous> (/app/node_modules/danger/distribution/runner/Executor.js:301:60)
2018-04-25T16:03:06.264699+00:00 app[web.1]: at step (/app/node_modules/danger/distribution/runner/Executor.js:32:23)
const Queue = require('bull');
const sendQueue = new Queue('Server A');
const count = 10000;
sendQueue.process((job, done) => {
for (let i = 0; i < count; i++) {
const number = Math.round(i * 100 / count);
job.progress(number);
}

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@shortcircuit3
shortcircuit3 / colors.swift
Created September 25, 2017 19:19
How to name colors in a pattern library
// Bad
whitePaleColor()
whiteEightColor()
buttonBorderColor()
coolGrayColor()
greyishBrown2Color()
slateGrayColor()
paleGrayColor()
paleGrey2Color()
whiteAlmostOpaque()
@shortcircuit3
shortcircuit3 / header.html
Created July 21, 2017 20:36
Responsive tachyons header
<header class="w-100 z-max h3 bg-purple fixed top-0">
<div class="dt ph3 w-100 center h-100">
<div class="dtc v-mid tl w-50">
<a href="/" class="f5 f4-ns fw6 link white-70" title="Home">EC1 WEB</a>
<small class="white-70 fw2">tagline goes here</small>
</div>
<nav class="dn dtc-ns v-mid w-50 tr">
<a title="home" href="index.html"
class="f6 fw6 glow link white o-70 mr2 mr3-m mr4-l">
@shortcircuit3
shortcircuit3 / convertValue.swift
Last active May 11, 2017 15:03
A function to translate a number between two different ranges
// convertValue()
// VALUE
// The number to input into the equation.
// To consider: What will the starting and ending value be?
//
// R1MIN
// The starting input range. What is the lowest number that VALUE will have?
//
// R1MAX