Skip to content

Instantly share code, notes, and snippets.

from functools import total_ordering
@total_ordering
class SortableNone(object):
def __eq__(self, other):
return self is other
def __le__(self, other):
return True
@mdellavo
mdellavo / InspIRCd-README.md
Last active January 11, 2019 14:55
Basic setup of an InspIRCd IRC server instance for Ubuntu

Basic InspIRCd Setup

  • SSL only
  • valid Let's Encrypt cert.
  • unbound for upstream dns queries
  • simplified admin config for small team
# install ircd
sudo apt-get install inspircd unbound
('Module',
{'body': [('FunctionDef',
{'args': ('arguments',
{'args': [],
'defaults': [],
'kw_defaults': [],
'kwarg': None,
'kwonlyargs': [],
'vararg': None},
{}),

SafeString

A subclass of string that protects from unauthorized representation, returning a masked value.

class BasicChecker(object):
    def __init__(self, allowed):
        self.allowed = allowed

    def check_can_show(self):
{
__schema {
types {
name
description
fields {
name
type {
name
kind
@mdellavo
mdellavo / anydict.py
Last active September 26, 2018 15:28
class AnyDict(dict):
"""
>>> AnyDict(foo=1) == {"foo": 1, "bar": 2}
True
>>> AnyDict(foo=2) == {"foo": 1, "bar": 2}
False
"""
def __eq__(self, other):
return isinstance(other, dict) and dict(other, **self) == other
@mdellavo
mdellavo / skybox
Last active September 17, 2018 02:15
glEnable(<int> 0xBE2)
glEnable(<int> 0xB71)
glEnable(<int> 0x809D)
glClear(<int> 0x4100)
glUseProgram(<int> 0x1)
glBindVertexArray(<int> 0x2)
glBindBuffer(<int> 0x8892, <int> 0x1)
glActiveTexture(<int> 0x84C0)
glBindTexture(<int> 0x8513, <int> 0x1)
glDepthMask(<boolean> false)
glFinish()
2018-08-10 16:11:54.049 java[19614:1289073] pid(19614)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
glGetError() = 0
glViewport(<int> 0x0, <int> 0x0, <int> 0x400, <int> 0x300)
glClear(<int> 0x4000)
glGetError() = 0
glViewport(<int> 0x0, <int> 0x0, <int> 0x400, <int> 0x300)
glClear(<int> 0x4000)
set scene TestScene
num verts = 5136 / num faces = 3840
./espadon-bin
dyld: Library not loaded: /usr/local/lib/libSDL-1.2.0.dylib
Referenced from: /Users/marc/Downloads/espadon-osx-x86-64/./espadon-bin
Reason: image not found
Abort trap: 6

Quicksight Notes

Pipeline query

SELECT user_id, MAX(count) AS progress, MAX(created) AS "timestamp"
FROM live_analytics
WHERE type = 'ext_progress'
GROUP BY user_id