Skip to content

Instantly share code, notes, and snippets.


Andy Kish Kobold

  • TenantBase
  • Santa Monica, CA
View GitHub Profile
slowkow /
Last active April 19, 2023 07:01
A simple version of the Needleman-Wunsch algorithm in Python.
#!/usr/bin/env python
The Needleman-Wunsch Algorithm
This is a dynamic programming algorithm for finding the optimal alignment of
two strings.
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
View read-access.sql
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
-- Grant access to future tables
atticoos / asyn-redux-middleware.js
Last active September 23, 2016 17:21
Asynchronous action middleware example for Redux
View asyn-redux-middleware.js
const Status = {
REQUEST: 'requrest',
SUCCESS: 'success',
FAILURE: 'failure'
function requestAction (payload, type) {
return {
status: Status.REQUEST,
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Websocket Scale</title>
silvenon /
Last active April 11, 2019 08:45
An example dropdown using Tether Drop, React Portal and Redux.

Tether Drop + React Portal + Redux

This is an example of using Tether Drop with React Portal (and Redux for managing the state). I was asked if using React Portal is redundant, as both libraries pull the content into the <body>. Using only Drop would cause an invariant violation in React becuase of the DOM mutation, so I'm using React Portal to first bring it outside without React complaining (I don't know how React Portal does it, I haven't checked out the source, but it works). Once it's out of React's supervision, I can apply Drop to it.

  • Dropdown.jsx is the actual dropdown component
  • App.jsx is just an demo that uses it

This is my lazy way out of this limitation using an existing library that has much more features than you need, but chances are that you're going to need a library like React Portal anyway for stuff like modals.


toolness /
Last active May 9, 2023 07:52
Adventures in Python Core Dumping

Adventures in Python Core Dumping

After watching Bryan Cantrill's presentation on [Running Aground: Debugging Docker in Production][aground] I got all excited (and strangely nostalgic) about the possibility of core-dumping server-side Python apps whenever they go awry. This would theoretically allow me to fully inspect the state of the program at the point it exploded, rather than relying solely on the information of a stack trace.

paragonie-scott /
Last active May 17, 2023 23:30
An Open Letter to Developers Everywhere (About Cryptography)
mik01aj /
Last active April 21, 2017 13:02
How to use Tether with React

Tether is a great library for positioning stuff (tooltips, modals, hints, etc) in your web app.

But, as I use React, it was pretty problematic for me, as Tether mutates the DOM and React breaks miserably when it sees mutated DOM. The solution is to have the tethered element outside the part of the DOM tree which is controlled by React (in this case, I use document.body).

That's why I created 2 helpers to use Tether with React.

The first one, TetheredElement is a plain JS helper to create a new element, attach it to some other one via Tether, and populate it with some React component.

The second one, TetherTarget is a React component and it uses TetheredElement to integrate it further with React, so that you can attach components to each other with Tether, without leaving the cozy React/JSX world and worrying about manual DOM operations. Just write:

franzinc /
Created April 15, 2015 21:19
My script to alert me to Amazon AWS usage via email
#! /fi/cl/9.0/bin/linuxamd64.64/mlisp -#D
(in-package :user)
(defparameter *instance-exceptions*
;; these instances are known to be running and are exceptions:
(defparameter *volume-exceptions*
;; these instances are known to be running and are exceptions:
shymonk /
Last active June 2, 2023 04:19
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form


This is a common case in django ORM.

from django.db import models

class Author(models.Model):