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 / 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
"""
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 / nginx
Last active August 29, 2015 14:13 — forked from vdel26/nginx
#!/bin/sh
#
# chkconfig: 2345 55 25
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx
# For Debian, run: update-rc.d -f nginx defaults
# For CentOS, run: chkconfig --add nginx
#
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
@jsmits
jsmits / reverse_strings.go
Created December 7, 2014 12:25
Reverse strings using a task processor
// Code from my dotGo.eu 2014 presentation
//
// Copyright (c) 2014 John Graham-Cumming
//
// Implement a factory and a task. Call run() on your factory.
package main
import (
"bufio"
@jsmits
jsmits / spatialite_views.sql
Created December 3, 2014 09:23
Spatialite views examples
# spatialite views voorbeelden
# zie ook: http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/html/sp-view.html
##########################
### sewerage_pipe_view ###
##########################
CREATE VIEW sewerage_pipe_view AS
SELECT c.ROWID AS ROWID,
c.id AS id,
c.display_name AS display_name,
c.sewerage_type AS sewerage_type,
package main
import (
"code.google.com/p/go-tour/pic"
"image"
"image/color"
"math"
)
type Image struct {