Skip to content

Instantly share code, notes, and snippets.

@mehmetsefabalik
mehmetsefabalik / nginx-https-local.md
Last active March 20, 2025 12:05
Enable https on your local environment with nginx

enable https on your local environment

install mkcert and create certificates

brew install mkcert
mkcert -install
@dnmellen
dnmellen / brokers.py
Created October 20, 2020 10:33
Improved EagerBroker for dramatiq
from dramatiq.brokers.stub import StubBroker
class EagerBroker(StubBroker):
"""Used by tests to simulate CELERY_ALWAYS_EAGER behavior.
https://github.com/Bogdanp/dramatiq/issues/195
Modified by @dnmellen to support pipelines and groups
"""
def process_message(self, message):
@bonniss
bonniss / github-search-cheatsheet.md
Last active April 9, 2025 18:54
Github search cheatsheet from official docs.

Github Search Cheat Sheet

GitHub’s search supports a variety of different operations. Here’s a quick cheat sheet for some of the common searches.

For more information, visit our search help section.

Basic search

@RobertAKARobin
RobertAKARobin / python.md
Last active April 1, 2025 14:13
Python Is Not A Great Programming Language
@sergeyklay
sergeyklay / journalctl-cheatsheet.md
Last active April 8, 2025 04:54
Journalctl Cheat Sheet

Journalctl Cheat Sheet

Configuration

Permissions

To see messages from other users and the system as well as performing various log operations from a regular user add it to the group:

sudo usermod -aG systemd-journal $USER
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 17, 2025 09:00
set -e, -u, -o, -x pipefail explanation
@raprasad
raprasad / change_password.md
Last active August 14, 2024 20:22
django user; change password from shell

update django password

general changes

To use in dev environments

  • after python manage.py shell
from django.contrib.auth.models import User
@notian
notian / FileReader.php
Last active October 27, 2017 18:10
Directory / File reader using generators
<?php
class FileReader
{
private $filenames;
public function __construct($input)
{
if (is_file($input)) {
$this->filenames = [ $input ];
} elseif (is_dir($input)) {
@rik-degraaff
rik-degraaff / Matrix.java
Last active October 29, 2017 18:10
JMatrix stuff
import integers.*;
public interface Matrix<N extends _N, M extends _N> {
public double getElementAt(int x, int y);
public void setElementAt(int x, int y, double value);
public int numRows();
public int numCols();
public default String asString() {
final String nl = System.getProperty("line.separator");
@nasrulhazim
nasrulhazim / dowload-files-from-ftp-server-using-python3.md
Last active May 6, 2024 09:45
Download Files From FTP Server using Python3
from ftplib import FTP
from datetime import datetime

start = datetime.now()
ftp = FTP('your-ftp-domain-or-ip')
ftp.login('your-username','your-password')

# Get All Files
files = ftp.nlst()