Skip to content

Instantly share code, notes, and snippets.

View karlicoss's full-sized avatar
🌴
🐰

karlicoss

🌴
🐰
View GitHub Profile
@karlicoss
karlicoss / zotero_demo.org
Created April 5, 2021 07:41
zotero + orger

Maldacena - 2016 - The symmetry and simplicity of the laws of physics.pdf

https://iopscience.iop.org/article/10.1088/0143-0807/37/1/015802

[2021-04-01 Thu 20:54] on page 11

For example, a free neutron (outside a nucleus) decays in about 15 minutes to a proton, an electron and a neutrino.

[2021-04-01 Thu 21:02] on page 13

This is a correct argument for electromagnetism and it is also correct for the weak force for the same basic reason. At least it is true for the
version of the weak force described so far...

uh… don’t think I understand the whole wave argument really… why did they bring them up?

[2021-04-01 Thu 21:09] [[docview:/study/physics/Maldacena - 2016 - The sy

@karlicoss
karlicoss / wtf.py
Created October 6, 2020 23:02
sqlalchemy + typing + loggger WTF????
### NOTE: you need to keep hack_logger.py and main.py in separate files, otherwise it's not reproducing
### hack_logger.py
# NOTE: if you comment this out, it works fine
import typing
def enabled_for(*args, **kwargs):
return True
import logging
#!/usr/bin/env python3
import logging
import os
import sys
from pathlib import Path
PATHS = [] # type: ignore
STATE_PATH = "/tmp/state.json"
from datetime import datetime
from typing import List, Dict, NamedTuple, Iterator, Optional
from pathlib import Path
from kython.kompress import open as kopen
class Expense(NamedTuple):
dt: datetime
amount: float
currency: str
@karlicoss
karlicoss / init.el
Created September 29, 2019 10:28
Snipped for org-mode agenda to show presence of notes
(with-eval-after-load 'org-agenda
(defun my/org-has-children ()
(if (save-excursion (org-goto-first-child)) "▶" " ")
)
(add-to-list 'org-agenda-prefix-format '(
agenda . "%i%-3:(my/org-has-children) %-12:c%?-12t% s "
))
)
; Result:
@karlicoss
karlicoss / emfitqs-local-api.md
Created August 18, 2018 11:47 — forked from harperreed/emfitqs-local-api.md
EMFIT QS Sleep tracker location API

EMFIT Local API

There is a functional http server running on the device that can be crawled for realtime data. It runs on port 80 and uses plain http.

You will need to know the IP address if your emfit device.

shortdvm.htm

For demoing / testing with a web browser there is an auto-refreshing page that contains only HR and RR values, it’s name is shortdvm.htm

@karlicoss
karlicoss / inplace_merge_sort.cpp
Created July 12, 2016 00:43
In place merge sort
#include <iostream>
#include <algorithm>
#include <cassert>
#include <iterator>
using namespace std;
template <typename ForwardIterator>
void merge_into(ForwardIterator from, ForwardIterator mid, ForwardIterator to, ForwardIterator buffer) {
W = 2
a = 0
b = -a
L = 1
def rvar(name):
return var(name, domain='real')
W = var('W', domain='integer')
#include <iostream>
#include <sstream>
#include <array>
using namespace std;
enum class State {
FINISHED, UNFINISHED
};
@karlicoss
karlicoss / id_wtf.py
Created April 8, 2016 22:26
Python id() wtf
l = [4, 5, 6]
l2 = [1, 2, 3]
print(id(l))
print(id(l2))
print("--------")
print(id([4, 5, 6]))
print(id([1, 2, 3]))
# Result: