Instantly share code, notes, and snippets.

View metanic-security.txt
Contact: security@metanic.org
Encryption: https://keybase.io/monokrome
Acknowledgements: https://github.com/metanic/metanic/tree/master/CONTRIBUTORS.md
Permission: none
Policy: asfasfhttps://github.com/metanic/metanic/tree/master/SECURITY.md
View meow.js
(function __FORGOTTHENAME__(a, b) {
return () => {
a(...args) // Create a side effect
return b(...args) // Return result of calling b
}
})
View managers.py
import typing
from django.db.models import Manager
from django.db.models.query import QuerySet
class TopicManager(Manager):
def having_names(self, names: str, *, create_missing: bool = False, **create_kwargs: typing.Dict[str, typing.Any]) -> QuerySet:
if not len(names):
return self.none()
View keybase.md

Keybase proof

I hereby claim:

  • I am monokrome on github.
  • I am monokrome (https://keybase.io/monokrome) on keybase.
  • I have a public key ASAf75zfHTn9s38idtG2TbNyEW5STSEBdlbZhAp1UYJw0wo To claim this, I am signing this object:
{
  "body": {
    "key": {
View openvpn_resolvconf.bash
#!/usr/bin/env bash
# Rename this to `$vpn_state` to be more semantically useful. `$script_type` is
# a really weird name.
vpn_state=$script_type
case $vpn_state in
up)
nameservers=()
search=()
View flex.jsx
import React from 'react'
import styled from 'styled-components'
function flex(name, defaultValue) {
return (props) => {
let value = props[name]
if (!value && typeof defaultValue === 'undefined') return ''
if (!value) value = defaultValue
return `flex-${name}: ${value};`
}
View firefox.md

Configuring/Hardening Firefox for Security and Privacy

Source for some of these

  1. about:config
  • dom.event.clipboardevents.enabled => false
  • clipboard.plainTextOnly => true
  • referer spoofSource => true
  • media.peerconnection
View firefox.md

Configuring/Hardening Firefox for Security and Privacy

Source for some of these

  1. about:config
  • dom.event.clipboardevents.enabled => false
  • clipboard.plainTextOnly => true
  • referer spoofSource => true
  • media.peerconnection
View getPagination.js
#!/usr/bin/env node
const DEFAULT_PAGINATION_SIZE = 9
const ELLIPSIS = '...'
function getPagination(currentPage, numberOfPages, maxSize) {
if (numberOfPages === 1) {
return [1]
View keybase.md

Keybase proof

I hereby claim:

  • I am monokrome on github.
  • I am monokrome (https://keybase.io/monokrome) on keybase.
  • I have a public key whose fingerprint is 914A AEF0 1B34 9BD3 1BBB 7DF7 D434 E971 4038 FCCB

To claim this, I am signing this object: