Skip to content

Instantly share code, notes, and snippets.

View endvvell's full-sized avatar
🫀

Ivan endvvell

🫀
  • Kyiv, Ukraine
  • 12:54 (UTC +02:00)
View GitHub Profile
@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")
@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*))
@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)
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active February 27, 2025 08:26
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

@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"]])
@fnky
fnky / ANSI.md
Last active March 10, 2025 07:01
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@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
@zelark
zelark / pg_test.types.clj
Last active February 2, 2024 19:47
Support json and jsonb Postgres types in Clojure.
;; For supporting more PG types, see https://github.com/remodoy/clj-postgresql
(ns pg-test.types
(:require [cheshire.core :as json]
[clojure.java.jdbc :as jdbc])
(:import [org.postgresql.util PGobject]
[java.sql PreparedStatement]))
;; Writing
(defn- to-pg-json [data json-type]
@duhaime
duhaime / TrackballControls.js
Last active July 29, 2024 01:23
Three.js: Indexed Buffer Geometry with Texture and Custom Shader Attributes
THREE.TrackballControls=function(e,t){var o=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new THREE.Vector3;var s=new THREE.Vector3,c=n.NONE,a=n.NONE,i=new THREE.Vector3,r=new THREE.Vector2,p=new THREE.Vector2,h=new THREE.Vector3,d=0,u=new THREE.Vector2,E=new THREE.Vector2,m=0,l=0,g=new THREE.Vector2,y=new THREE.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var v={type:"change"},w={type:"start"},T={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var
@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active March 7, 2025 18:06 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "[email protected]"