Skip to content

Instantly share code, notes, and snippets.

View tbhartman's full-sized avatar

Tim Hartman tbhartman

  • Dassault Systèmes
  • Providence, RI
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"
xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"
@tbhartman
tbhartman / README.md
Last active February 10, 2021 21:36
Benchmark reading large files in go

Benchmark reading large files in go

go test -bench . -benchmem -benchtime 0.2s

goos: windows
goarch: amd64
pkg: <redacted>
BenchmarkBufferSize/1e3-8                      3          75666900 ns/op            1704 B/op          9 allocs/op
@tbhartman
tbhartman / explicit_wasm_ko.go
Last active December 3, 2020 18:26
Golang WasmCrash
package main
func fillStringArray(ss *[]string) {
(*ss)[0] = ""
(*ss)[1] = ""
(*ss)[2] = ""
(*ss)[3] = ""
(*ss)[4] = ""
(*ss)[5] = ""
(*ss)[6] = ""
alias.tree=log --graph --decorate --pretty=oneline --abbrev-commit -n10
@tbhartman
tbhartman / scan_archive_doc.py
Created July 14, 2014 01:54
scanimage helper app
#!/usr/bin/env python
import argparse
import subprocess
import tempfile
import os
import logging
if __name__ == '__main__':
logging.getLogger().setLevel(0)
@tbhartman
tbhartman / ask_delete.py
Created June 27, 2014 19:06
disable overwrite confirmation for Abaqus jobs
ENV_FILENAME = 'abaqus_v6.env'
OPEN_MODE = 'a'
LINE = 'ask_delete=OFF'
with open(ENV_FILENAME,OPEN_MODE) as f:
f.write('\n'+LINE+'\n')
@tbhartman
tbhartman / avg.py
Last active August 29, 2015 14:02
read stdin and report entries, sum, and average
"""
average from stdin
reads stdin, one entry per line. prints out number of entries, sum,
and average of entries. reports error if it cannot interpret as
floats.
"""
import sys
#!/usr/bin/perl
#
# Eric Jiang
# http://notes.ericjiang.com/posts/54
# This software is public domain.
#
use bytes;
my $data;