Skip to content

Instantly share code, notes, and snippets.

View abenezerBelachew's full-sized avatar
🐎
What weighs more? A 200 kg horse or a 200 kg mattress?

Abenezer Belachew abenezerBelachew

🐎
What weighs more? A 200 kg horse or a 200 kg mattress?
View GitHub Profile
.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go
@mtrung
mtrung / Android TimeZone Ids
Last active August 23, 2022 09:06 — forked from arpit/Android TimeZone Ids
As of July 2015, there are 582 Java/Android TimeZone Ids. Note that this list is subject to change (there are 23 additions and 2 deletions from 2011 to 2015).
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active March 26, 2024 01:21
A sample README for all your GitHub projects.

Repository Title Goes Here

Frances Coronel

INSERT GRAPHIC HERE (include hyperlink in image)

Subtitle or Short Description Goes Here

ideally one sentence >

@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active July 17, 2024 19:34
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active July 18, 2024 16:36
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).
@fjsj
fjsj / celery_settings.py
Last active May 12, 2024 12:37
Recommended Celery Django settings for reliability. For more details, check the DjangoCon 2023 talk "Mixing reliability with Celery for delicious async tasks" by Flávio Juvenal: https://youtu.be/VuONiF99Oqc
# Recommended Celery Django settings for reliability:
# (use `app.config_from_object('django.conf:settings', namespace='CELERY')`
# in proj/celery.py module)
from decouple import config # use python-decouple: https://github.com/HBNetwork/python-decouple
# Prefer RabbitMQ over Redis for Broker,
# mainly because RabbitMQ doesn't need visibility timeout. See:
# https://blog.daftcode.pl/working-with-asynchronous-celery-tasks-lessons-learned-32bb7495586b
# https://engineering.instawork.com/celery-eta-tasks-demystified-424b836e4e94
@chelseadole
chelseadole / duplicate_to_partitioned_table.sql
Created October 1, 2023 19:36
plpgsql function returning a trigger which duplicates INSERT/UPDATE/DELETE activity to a second partitioned table. Requires inputting correct table names & column values for use.
-- This function is designed to duplicate all live INSERTS/UPDATES/DELETES from one table (referred to as "source_table_name"
-- to a second partitioned table (referred to as "destination_table_name"). The function should be set to trigger after insert/
-- update/delete on the source table.
-- This function is designed to be leveraged for partitioned table migration through this method:
-- 1) Create an empty partitioned copy of the "source_table_name". Alter primary key as necessary, as partitioned Postgres
-- tables do not support unique/primary keys not included in the partition key.
-- 2) Create the following function, and attach it as a trigger to "source_table_name". At this point, incoming new DML is
-- being copied successfully to the partitioned table, so only historical data will need to be backfilled.
-- 3) Target rows in "source_table_name" with an updated_at value BEFORE the trigger was attached, and backfill them into
@OrionReed
OrionReed / dom3d.js
Last active July 18, 2024 03:49
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯