Skip to content

Instantly share code, notes, and snippets.

@mindriot101
mindriot101 / python_pymysql_notes.md
Created Sep 18, 2015
Notes about pymysql connections
View python_pymysql_notes.md

Database transactions

pymysql

  • Defaults to autocommit=False
connection = pymysql.connect(user='user', db='test')
cursor = connection.cursor()
cursor.execute('insert into test (value) values (10)')
@mindriot101
mindriot101 / networkbench.py
Created Mar 25, 2020
Script to run benchmark using iperf3
View networkbench.py
#!/usr/bin/env python3
import argparse
import subprocess as sp
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
@mindriot101
mindriot101 / cmakebuild.sh
Created Jan 6, 2019
Shell command used to run cmake to build FreeOpcUa on macos
View cmakebuild.sh
#!/bin/bash
# `brew install boost@1.55`
set -e
(
mkdir -p build
cd build
cmake .. \
@mindriot101
mindriot101 / scrollsave.html
Created Dec 27, 2017
Scroll position saver
View scrollsave.html
<!doctype html>
<html>
<head>
<meta charset="utf8">
<style>
div#main {
border: 1px solid black;
display: inline-block;
width: 1024px;
max-width: 1024px;
View ParallelExample.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View keybase.md

Keybase proof

I hereby claim:

  • I am mindriot101 on github.
  • I am srwalker101 (https://keybase.io/srwalker101) on keybase.
  • I have a public key ASAS5wq9O2nHTLIFKrJiRhkOXxkMHjzj-Z8lU6k1OPBSZwo

To claim this, I am signing this object:

@mindriot101
mindriot101 / sysrem_comparison.ipynb
Created Jan 25, 2016
Analysis of sysrem output, excluding known atypical stars
View sysrem_comparison.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View vim bundles file
" Global setup
" -------------
" Set no vi compatible
set nocompatible
" Nice vundle stuff
filetype off
let g:vundle_default_git_proto = 'git'
@mindriot101
mindriot101 / git-quick
Created Sep 5, 2013
git-quick file for quick git commit messages
View git-quick
#!/usr/bin/env bash
set -e
# This runs git commit -m but allows any arguments to be compiled into the message
# instead of requiring the wrapping with quotes
git commit -m "$*"
@mindriot101
mindriot101 / brew config
Last active Dec 20, 2015
Homebrew issue with luarocks #21382 With luarocks installed, the command `brew outdated` recompiles lots of lua code.
View brew config
> brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew.git
HEAD: c288e866c467531b0a1943d6a3fdd4fe4ea88610
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.7.5-x86_64
Xcode: 4.6.3
CLT: 4.6.0.0.1.1362189000