Skip to content

Instantly share code, notes, and snippets.

View isaacgr's full-sized avatar

Isaac isaacgr

View GitHub Profile
@nathansmith
nathansmith / web-design-development-learning-resources.md
Last active October 12, 2024 17:08
Resources for learning web design & front-end development
@whisperity
whisperity / daemon.sh
Last active March 15, 2019 01:05
Start arbitrary shell script as a background daemon from init.d
#!/bin/sh
### BEGIN INIT INFO
# Provides: scriptname
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Script short description
# Description: Starts/Stops the script
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@bishboria
bishboria / springer-free-maths-books.md
Last active October 3, 2024 09:17
Springer made a bunch of books available for free, these were the direct links
@v0lkan
v0lkan / docker-i-t-trivia.md
Last active July 25, 2023 04:35
docker run -i -t
docker run -i -t --name nodejs ubuntu:latest /bin/bash

So here, -i stands for interactive mode and -t will allocate a pseudo terminal for us.

Some more trivia about these flags.

@amitripshtos
amitripshtos / exception_middleware.py
Created July 18, 2017 08:56
Exception handling middleware for aiohttp (python 3.5)
def json_error(status_code: int, exception: Exception) -> web.Response:
"""
Returns a Response from an exception.
Used for error middleware.
:param status_code:
:param exception:
:return:
"""
return web.Response(
status=status_code,
@miharekar
miharekar / quotes.json
Last active November 29, 2023 09:34
Stoic Quotes JSON
This file has been truncated, but you can view the full file.
{"quotes":[{"text":"We have two ears and one mouth, so we should listen more than we say.","author":"Zeno of Citium, as quoted by Diogenes Laërtius"},{"text":"Man conquers the world by conquering himself.","author":"Zeno of Citium"},{"text":"The goal of life is living in agreement with Nature.","author":"Zeno"},{"text":"if being is many, it must be both like and unlike, and this is impossible, for neither can the like be unlike, nor the unlike like","author":"Zeno"},{"text":"Well-being is attained little by little, and nevertheless is no little thing itself.","author":"Zeno of Citium"},{"text":"The reason why we have two ears and only one mouth is that we may listen the more and talk the less.","author":"Zeno"},{"text":"When a dog is tied to a cart, if it wants to follow, it is pulled and follows, making its spontaneous act coincide with necessity. But if the dog does not follow, it will be compelled in any case. So it is with men too: even if they don't want to, they will be compelled to follow what is desti
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active November 16, 2024 17:43
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }