Skip to content

Instantly share code, notes, and snippets.

@sibelius
sibelius / entria.md
Last active April 22, 2021 01:05
Things that you gonna learn at Entria

Most job post are about requirements that you should already know.

We think that you should learn a lot when working for a company.

So here is a list of many things that you are going to learn while working for us (and many more):

  • how to use git to work in a team
  • how to contribute to open source projects
  • how to manage .env files (configurations)
  • local vs staging vs production environments
@jsjoeio
jsjoeio / README.md
Last active March 31, 2021 20:26
Calculate Fitbit Monthly Stats - Duration

Calculate Fitbit Monthly Stats - Duration

Unfortunately, the "Track My Activities on Fitbit" doesn't calculate the total hours (using duration) so I wrote a script that you can run in the console on the page to calculate the total.

@sibelius
sibelius / backendLearningPath.md
Created January 15, 2021 14:59
Backend Learning Path - Basics that you should learn
  • learn about basic database modelling, use excalidraw
  • learn how to connect to a database and performe queries
  • learn how to expose a CRUD API REST and/or GraphQL
  • learn how to document the API using Swagger, swagger-jsdoc is the best for it
  • learn how to test your API using Postman, and also automated using jest and supertest
  • learn how to consume other APIs using fetch

Also check Docker Learning Path and Lambda Learning Path

@kentcdodds
kentcdodds / README.md
Last active March 30, 2024 11:39
user-package-stats

user-package-stats

I was poking around trying to figure out all the packages I have access to publish and got curious. So I write this little script to determine the download stats for all the packages I have publish access to.

Feel free to try it yourself. Just change the username passed to getUserDownloadStats.

By default, the stats are sorted by their average daily downloads (descending). That should give you an idea of the most "popular" package of a given user relative to how long that package has been around.

You can use it with npx like so:

@mmazzarolo
mmazzarolo / service-workers.md
Last active April 22, 2024 03:40
Service Workers Tips

Service Workers Tips

Reloading a service worker

Reloading a page won't update/remove the previous version of its service worker. To make sure you're using the latest version of your service worker, make sure to check the "Update on reload" toggle in the "Application" ⭢ "Service Workers" section of the Chrome DevTools.

Simulate a network condition

To simulate a network condition (e.g.: offline, 3g, etc...) in a service worker on Chrome, uncheck the "Update on reload" toggle.

ActiveRecord Demo

This gist has become cincinnatirb/active_record_demo. You can watch a (near perfect) run-through on YouTube here.

In this demo we will:

  • Revisit Rails generators
  • Learn more about Microsoft's Visual Studio Code and some of its features
  • Expand our use of git for source code control
  • Explore use of the DB Browser for SQLite to explore the internals of a SQL database
  • Be quickly introduced to Rails routing, controllers and views
  • Implement our first feature request
async function validatePassword(password: string): string[] {
let errors = []
// 1. Don't regex for things you can trivially express in code
// -----------------------------------------------------------
// For example, we could have written this as `/^.{0,7}$/` but that's not
// nearly as clear as checking the length of the string.
if (password.length < 8) {
errors.push("Password must be at least 8 characters long")
@maxkostinevich
maxkostinevich / worker.js
Created June 29, 2020 11:25
Serverless Geolocation Service
/*
* Serverless Geolocation Service, hosted on Cloudflare Workers.
*
* Learn more at https://maxkostinevich.com/blog/serverless-geolocation
*
* (c) Max Kostinevich / https://maxkostinevich.com
*/
// https://gist.github.com/maephisto/9228207
@sibelius
sibelius / faviconGen.sh
Created June 23, 2020 11:12
Generate a favicon from an image or svg file
#!/usr/bin/env bash
magick convert $1 -resize 16x16 16.png
magick convert $1 -resize 32x32 32.png
magick convert $1 -resize 48x48 48.png
magick convert 16.png 32.png 48.png favicon.ico