Skip to content

Instantly share code, notes, and snippets.

View jsmits's full-sized avatar

Sander Smits jsmits

  • DeepHealth
  • The Netherlands
View GitHub Profile
@jsmits
jsmits / words.md
Created April 14, 2024 08:42 — forked from fogleman/words.md
Mnemonic Encoding Word List

Mnemonic Encoding Word List

http://web.archive.org/web/20090918202746/http://tothink.com/mnemonic/wordlist.html

  • The wordlist contains 1626 words.
  • All words are between 4 and 7 letters long.
  • No word in the list is a prefix of another word (e.g. visit, visitor).
  • Five letter prefixes of words are sufficient to be unique.
  • The words should be usable by people all over the world. The list is far from perfect in that respect. It is heavily biased towards western culture and English in particular. The international vocabulary is simply not big enough. One can argue that even words like "hotel" or "radio" are not truly international. You will find many English words in the list but I have tried to limit them to words that are part of a beginner's vocabulary or words that have close relatives in other european languages. In some cases a word has a different meaning in another language or is pronounced very differently but for the purpose of the encoding it is still ok - I assume that when the encoding is
@jsmits
jsmits / finetune_llama_v2.py
Created July 21, 2023 14:51 — forked from younesbelkada/finetune_llama_v2.py
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@jsmits
jsmits / convert-arraybuffer.js
Created November 8, 2021 08:18 — forked from nuclearglow/convert-arraybuffer.js
ArrayBuffer <-> JSON <-> ArrayBuffer
// array buffer to JSON
const dataString JSON.stringify(Array.from(new Uint8Array(arrayBuffer)));
// send around
// JSON to ArrayBuffer
new Uint8Array(JSON.parse(dataString)).buffer
@jsmits
jsmits / client.js
Created November 3, 2021 22:15 — forked from hagino3000/client.js
WebSocket with binary data
var socket = null;
function bootstrap() {
// 適当な図形を描画
var c = document.getElementById('mycanvas');
var ctx = c.getContext('2d');
ctx.globalalpha = 0.3;
for(var i=0; i<1000; i++) {
ctx.beginPath();
@jsmits
jsmits / .eslintrc.js
Created June 18, 2020 19:37 — forked from adrianhall/.eslintrc.js
A sample .eslintrc file
var OFF = 0, WARN = 1, ERROR = 2;
module.exports = exports = {
"env": {
"es6": true
},
"ecmaFeatures": {
// env=es6 doesn't include modules, which we are using
"modules": true
@jsmits
jsmits / flake8.xml
Last active August 2, 2018 16:52
PyCharm 3.x Flake8 Configuration XML
<toolSet name="Code Checking">
<tool name="Flake8" showInMainMenu="true" showInEditor="true" showInProject="true" showInSearchPopup="true" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="/usr/local/bin/flake8" />
<option name="PARAMETERS" value="--max-complexity 10 $FilePath$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
<filter>
<option name="NAME" value="Filter 1" />
<option name="DESCRIPTION" />
"""
DICOM-QR utilities.
Depends on pynetdicom3: https://github.com/scaramallion/pynetdicom3
"""
import json
from typing import Dict, Optional
import click
import structlog
"""Controller code design in Python as guideline for implementing this in Fortran."""
# update: 2017-04-05: PID and switch controllers differ enough from the simple and delta controllers
# that a new code structure plan is justified. In my (Sander's) opinion it's better and more
# future-proof to give each controller its own class and implementation. That way, it's easier
# to add new controller implementations.
# action types
# ============
#
@jsmits
jsmits / omelette2venv.py
Last active December 24, 2015 21:39
File for adding buildout omelette paths to virtualenv in vagrant for use by PyCharm. With this file, PyCharm can use the omelette packages from the vagrant remote interpreter. Usage: tweak paths in file if necessary, make it executable and put it in /usr/local/bin. Then run omelette2venv.py.
#!/usr/bin/env python
import os
def main(omelette_dir='/srv/parts/omelette'):
"""
Workaround to enable PyCharm to get access to the project modules.
Requirements:
- omelette directory created by buildout
- a virtualenv with the system packages named /home/vagrant/venv
(trac)[jsmits@imac:~/.virtualenvs/trac]$ gunicorn --workers=1 wsgi:app
2010-03-20 13:03:37 [88765] [INFO] Arbiter booted
2010-03-20 13:03:37 [88765] [INFO] Listening at: http://127.0.0.1:8000
2010-03-20 13:03:37 [88766] [INFO] Worker spawned (pid: 88766)
2010-03-20 13:04:02 [88766] [ERROR] Error processing request.
Traceback (most recent call last):
File "/Users/jsmits/.virtualenvs/trac/lib/python2.6/site-packages/gunicorn/worker.py", line 153, in handle
response = self.app(req.read(), req.start_response)
File "/Users/jsmits/.virtualenvs/trac/lib/python2.6/site-packages/trac/web/main.py", line 420, in dispatch_request
return _dispatch_request(req, env, env_error)