Skip to content

Instantly share code, notes, and snippets.

View danielcaldas's full-sized avatar
👋

Daniel Caldas danielcaldas

👋
View GitHub Profile
@lukestephenson-zendesk
lukestephenson-zendesk / ElasticSearch.scala
Last active June 18, 2020 00:22
Efficient Kafka Consumers workshop
package com.zendesk.zts.search
import com.typesafe.scalalogging.StrictLogging
import monix.execution.Scheduler.Implicits.global
import monix.eval.Task
import monix.execution.atomic.AtomicInt
import scala.concurrent.duration._
import scala.concurrent.Future
@callumlocke
callumlocke / .zshrc
Last active March 24, 2024 08:12
ZSH function to auto-switch to correct Node version
####
# ZSH function to auto-switch to correct Node version
# https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5
#
# - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does.
#
# - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING.
#
# - Works correctly if your .nvmrc file contains something relaxed/generic,
# like "4" or "v12.0" or "stable".
let NETWORK_PRESETS = {
'GPRS': {
'offline': false,
'downloadThroughput': 50 * 1024 / 8,
'uploadThroughput': 20 * 1024 / 8,
'latency': 500
},
'Regular2G': {
'offline': false,
'downloadThroughput': 250 * 1024 / 8,
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active May 2, 2024 03:18
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 3, 2024 06:43
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@ldez
ldez / gmail-github-filters.md
Last active April 3, 2024 11:53
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
@franciscbalint
franciscbalint / restart_bluetooth.sh
Last active July 19, 2018 12:00 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X/macOS Sierra without restarting
#!/bin/bash
# To run this script you need to give execute permission.
# $chmod +x restart_bluetooth.sh;
# If you want only to restart:
# $ ./restart_bluetooth.sh;
# If you want to turn bluetooth on;
# $ ./restart_bluetooth.sh 1;
# If you want to turn bluetooth off;
# $ ./restart_bluetooth.sh 0;
@elgervb
elgervb / debug.handlebars.js
Last active February 4, 2019 16:55
Handlebars debug helper
/**
* Register a debug helper for Handlebars to be able to log data or inspect data in the browser console
*
* Usage:
* {{debug someObj.data}} => logs someObj.data to the console
* {{debug someObj.data true}} => logs someObj.data to the console and stops at a debugger point
*
* https://gist.github.com/elgervb/5c38c8d70870f92ef6338a291edf88e9
*
* @param {any} the data to log to console
@gokulkrishh
gokulkrishh / media-query.css
Last active May 3, 2024 06:40
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@paulirish
paulirish / what-forces-layout.md
Last active April 30, 2024 17:56
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent