Skip to content

Instantly share code, notes, and snippets.

@dbarnett
dbarnett / gist:b7dc25e57c3d13c65e5fadcb754c7dae
Created October 4, 2024 16:40
(Miaou identity verification)
I am the Miaou user with id 7718 and name "mu_mind" on https://miaou.dystroy.org
diff --git a/lib/src/parser/mod.rs b/lib/src/parser/mod.rs
index 032c79870f..7d5670577f 100644
--- a/lib/src/parser/mod.rs
+++ b/lib/src/parser/mod.rs
@@ -1,8 +1,9 @@
use crate::data::VimModule;
use crate::{Error, VimNode, VimPlugin};
use std::ffi::OsStr;
-use std::path::{Path, PathBuf};
+use std::path::Path;
@dbarnett
dbarnett / .vimrc
Created March 28, 2020 16:18
Sample minimal .vimrc for reproducing vim-codefmt bug xyz
call plug#begin('~/.vim/plugged')
Plug 'google/vim-maktaba'
Plug 'google/vim-codefmt'
Plug 'google/vim-glaive'
call plug#end()
call glaive#Install()
"""
Response to
http://venodesigns.net/2010/11/02/emulating-rubys-method_missing-in-python/
If you're going to enumerate each "missing method" and its args, why not just
define a stub?
"""
class Twython(object):
def __init__(self, params):
@dbarnett
dbarnett / pip_anyjson.trace
Created February 26, 2012 20:40
snippet from python -m trace --trace pdb install dist/anyjson-0.3.1.tar.gz
This file has been truncated, but you can view the full file.
--- modulename: req, funcname: prepare_files
req.py(898): unnamed = list(self.unnamed_requirements)
req.py(899): reqs = list(self.requirements.values())
--- modulename: req, funcname: values
req.py(754): values_list = []
req.py(755): for key in self._keys:
req.py(757): return values_list
req.py(900): while reqs or unnamed:
req.py(901): if unnamed:
req.py(902): req_to_install = unnamed.pop(0)
@dbarnett
dbarnett / cars.py
Created February 11, 2012 07:26
Object-oriented demonstration for SO question http://stackoverflow.com/q/9237725/307705
import random
class Vehicle(object):
def __init__ (self, _id):
self.company = None
self.id = _id
def printDoors(self):
print 'Car ' + str(self.id) + ' has ' + str(self.doors) + ' doors.'
@dbarnett
dbarnett / jsonalchemy.py
Created February 3, 2012 15:10
JSONAlchemy: Proper JSON marshalling and mutation tracking in SQLAlchemy
import simplejson
import sqlalchemy
from sqlalchemy import String
from sqlalchemy.ext.mutable import Mutable
class JSONEncodedObj(sqlalchemy.types.TypeDecorator):
"""Represents an immutable structure as a json-encoded string."""
impl = String
#!/usr/bin/env python
import glob
import os
import setuptools
import sys
import types
def show_all_files(*args, **kw):
# package files