Skip to content

Instantly share code, notes, and snippets.

View endvvell's full-sized avatar
🫀

Ivan endvvell

🫀
  • Kyiv, Ukraine
  • 10:39 (UTC +03:00)
View GitHub Profile
@thismatters
thismatters / 0001_migrate_to_encrypted.py
Last active August 11, 2024 10:48
Migrating existing columns to use django-cryptography
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django_cryptography.fields import encrypt
app_with_model = 'account'
model_with_column = 'User'
column_to_encrypt = 'email_address'
column_field_class = models.CharField
@fnky
fnky / ANSI.md
Last active May 11, 2025 04:58
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@illiichi
illiichi / project.clj
Last active December 22, 2023 22:33
pseudoethnological clojure code in 30 lines
(defproject pseudoethnological "0.1.0-SNAPSHOT"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:jvm-opts ["-Xmx2g" "-server"]
:dependencies [[org.clojure/clojure "1.8.0"]
[overtone "0.10.3"]])
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active April 30, 2025 07:51
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@AndreasDickow
AndreasDickow / views.py
Last active May 12, 2024 17:25
Fix object has no attribute 'object_list' when post create duplicate in Django-Tables2 ListView
class mylist(SingleTableMixin, FilterView):
...
def get_context_data(self, **kwargs):
queryset = kwargs.pop('object_list', None)
if queryset is None:
self.object_list = self.model.objects.all()
...
return super().get_context_data(**kwargs)
@borkdude
borkdude / test_args.clj
Created November 8, 2022 12:15
Clojure deftest with arguments
;; {:deps {org.babashka/cli {:mvn/version "0.5.40"}
;; babashka/fs {:mvn/version "0.1.11"}}}
(ns test-args
{:clj-kondo/config '{:lint-as {test-args/deftest clojure.core/defn}}}
(:require
[babashka.cli :as cli]
[clojure.test :as t :refer [is]]))
(def ^:dynamic *test-args* (cli/parse-opts *command-line-args*))
@kayomarz
kayomarz / gist:65e0d124f008b222ddf317e9f920c37f
Created August 14, 2023 03:57
Uninstall / Remove all software installed via quicklisp
;;; Start lisp, for example run sbcl.
;;; $ sbcl
;;; First uninstall all systems.
;;; ref: https://github.com/quicklisp/quicklisp-client/issues/147#issuecomment-1631778086
(mapc #'ql:uninstall (mapcar #'ql-dist:short-description (ql-dist:installed-systems t)))
;;; To be able to use slime, we install the slime helper
(ql:quickload "quicklisp-slime-helper")