Skip to content

Instantly share code, notes, and snippets.

@mtornwall
mtornwall / OMXS30.csv
Created March 31, 2024 12:16
OMXS30 2000-01-01 to 2024-01-01 (HLC values only).
Date High Low Close
2023-12-29 2403.19 2390.87 2396.07
2023-12-28 2398.91 2384.45 2389.01
2023-12-27 2398.86 2378.43 2390.28
2023-12-22 2384.03 2365.09 2377.05
2023-12-21 2382.93 2364.94 2375.14
2023-12-20 2394.61 2376.72 2390.84
2023-12-19 2391.41 2376.86 2384.54
2023-12-18 2384.70 2371.53 2374.17
2023-12-15 2395.44 2373.35 2386.43
@mtornwall
mtornwall / Nasdaq_OMXS_Large_Cap.txt
Created March 30, 2024 15:33
Nasdaq OMXS Large Cap stocks minus preferred (A) stocks.
AZN.ST
ABB.ST
ATCO-B.ST
INVE-B.ST
VOLV-B.ST
NDA-SE.ST
EQT.ST
ASSA-B.ST
HEXA-B.ST
SEB-C.ST
@mtornwall
mtornwall / Nasdaq_OMXS_All.txt
Created March 30, 2024 13:51
All stocks listed on Nasdaq OMXS (Stockholm Stock Exchange) per 30/4 2024.
AZN.ST
ABB.ST
ATCO-A.ST
ATCO-B.ST
INVE-A.ST
INVE-B.ST
VOLV-A.ST
VOLV-B.ST
NDA-SE.ST
EQT.ST
#include <cstdio>
#include <random>
int main(){
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> dis('a', 'z');
char arr[10] = {0};
for(int j=0;j<10;j++){
for(int i =0;i<9;i++){
#!/bin/sh
# Snarf a file or the output of a command into the
# X11 paste buffer using xclip(1).
if [ -z $1 ]; then
name=`basename $0`
echo "Usage: $name [command] <arg1> ... <argN>, or"
echo " $name [file]"
exit 1
fi
#ifndef TC_H
#define TC_H
#define TC_BLOCK_SIZE 8192 /* Size of a Trenta block in bytes. */
#define TC_HASH_SIZE 40 /* Size of Trenta's block hash in bytes. */
struct tclient;
typedef struct tclient TClient;
typedef unsigned int TLength;
@mtornwall
mtornwall / gist:6217806
Created August 13, 2013 04:07
naïve utf8 encode/decode
#include <stdio.h>
#include <string.h>
#include <stdint.h>
typedef uint32_t rune;
uint8_t *
encode(rune *runes, uint8_t *buf, size_t length)
{
for (size_t i = 0; i < length; i++) {
(define (fib n)
(if (<= n 1) n
(+ (fib (- n 1)) (fib (- n 2)))))
;; (define (fib-iter n1 n2)
;; (if (< n2 2)
;; (+ n1 n2)
;; (fib-iter n2 (+ n1 n2))))
;; (define (fib-iter-cps n1 n2 k)
@mtornwall
mtornwall / gist:6020868
Created July 17, 2013 14:10
derpy derp jit for basic arithmetic in Go
package main
// int callGate(void* p) {
// return ((int (*)())p)();
// }
import "C"
import (
"os"
"io"
@mtornwall
mtornwall / gist:5630756
Created May 22, 2013 20:45
emacs mark 80th column
;; Download fci-mode from http://www.emacswiki.org/emacs/fill-column-indicator.el
;; Add this to .emacs.d/init.el
(require 'fill-column-indicator)
(define-globalized-minor-mode global-fci-mode
fci-mode (lambda () (fci-mode 1)))
(setq-default fci-rule-color "red")
(setq-default fci-rule-column 80)
(global-fci-mode 1)