Skip to content

Instantly share code, notes, and snippets.

@plumps
plumps / lib.py
Last active October 12, 2016 20:21
converted to python3
import os
import mmap
import ctypes
import struct
class SHMWriter(object):
def __init__(self, filename='/tmp/mmaptest'):
self.filename = filename
@plumps
plumps / ml-python-env.nix
Created October 17, 2016 21:21
python env for #ml
with import <nixpkgs> {};
with python35Packages;
python.withPackages (ps: with ps; [ numpy pandas matplotlib jupyter ])
class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
for cx, x in enumerate(nums):
for cy, y in enumerate(nums):
if x + y == target and cx != cy:

Keybase proof

I hereby claim:

  • I am plumps on github.
  • I am plumps (https://keybase.io/plumps) on keybase.
  • I have a public key ASAGy7UmqD27fji6WUXuWUAi3YcTKN1YkhvZA1d9Qlh5FAo

To claim this, I am signing this object:

@plumps
plumps / buildout.py
Created November 2, 2016 09:06
directory deployment failed
➜ fc.directory.deployment default ./batou deploy vagrant-dev
Installing setuptools==19.7
Installing hg+https://bitbucket.org/flyingcircus/batou_ext@c86159a8a0e8#egg=batou_ext
batou/1.3b4.dev0 (CPython 2.7.12-final0, Darwin 15.6.0 x86_64)
=================================================================== Preparing ===================================================================
main: Loading environment `vagrant-dev`...
main: Verifying repository ...
You are using rsync. This is a non-verifying repository -- continuing on your own risk!
main: Loading secrets ...
@plumps
plumps / input.json
Last active November 3, 2016 12:48
{
"global": false,
"node": "39a9ce98-f239-47dc-b0ff-becb4858e215",
"configuration": {
"expand_structured_data": false,
"force_rdns": false,
"store_full_message": false,
"bind_address": "0.0.0.0",
"recv_buffer_size": "262144",
"allow_override_date": true,
@plumps
plumps / madlibs.py
Created February 22, 2017 22:47
automatetheboring shit: chapter 8, madlibs
# Create a Mad Libs program that reads in text files and lets the user add
# their own text anywhere the word ADJECTIVE, NOUN, ADVERB, or VERB
# appears in # the text file. For example, a text file may look like this:
# The ADJECTIVE panda walked to the NOUN and then VERB. A nearby NOUN was
# unaffected by these events.
# The program would find these occurrences and prompt the user to replace them.
# Enter an adjective:
@plumps
plumps / index.html
Created April 5, 2017 19:45
Tribute to Kraftwerk
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
<div class="container-fluid">
<h1 id="h">
<span class="yellow">K</span><span class="orange">R</span><span class="fuschia">A</span><span class="purple">F</span><span class="blue">T</span>WERK</h1>
<div id="sub">pioneers of electronic music</div>
<div class="row">
</p>
<div class="col-xs-6">
<p class="grey">// Introduction ----------</p>
nix-channel --list
monte https://hydra.matador.cloud/project/monte/channel/latest
nixpkgs https://nixos.org/channels/nixpkgs-unstable
ls /nix/var/nix/gcroots/profiles/per-user/plumps/channels/
binary-caches manifest.nix monte nixos-16.09 nixpkgs
@plumps
plumps / txt
Created July 29, 2017 10:15
msinfo32: system summary
System Information report written at: 07/29/17 12:13:14
System Name: WINTERMUTE
[System Summary]
Item Value
OS Name Microsoft Windows 10 Pro
Version 10.0.15063 Build 15063
Other OS Description Not Available
OS Manufacturer Microsoft Corporation
System Name WINTERMUTE