- Download docker-compose.yml to dir named
sentry
- Change
SENTRY_SECRET_KEY
to random 32 char string - Run
docker-compose up -d
- Run
docker-compose exec sentry sentry upgrade
to setup database and create admin user - (Optional) Run
docker-compose exec sentry pip install sentry-slack
if you want slack plugin, it can be done later - Run
docker-compose restart sentry
- Sentry is now running on public port
9000
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import argparse | |
import hashlib | |
import hf_transfer # py -m pip install hf-transfer | |
CHUNK_SIZE = 10_485_760 | |
parser = argparse.ArgumentParser(description='HuggingFace fast model downloader') | |
parser.add_argument('--url', type=str, help='file url') | |
args = parser.parse_args() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy import pi | |
# import matplotlib.pyplot as plt | |
N = 400 | |
theta = np.sqrt(np.random.rand(N))*2*pi # np.linspace(0,2*pi,100) | |
r_a = 2*theta + pi | |
data_a = np.array([np.cos(theta)*r_a, np.sin(theta)*r_a]).T | |
x_a = data_a + np.random.randn(N,2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.
There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.
1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]
struct foo {
struct bar {
int x;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Load foreign-function-interface handle | |
local ffi = require("ffi") | |
-- Shortcut FFI C namespace | |
local C = ffi.C | |
-- Load Windows kernel32 DLL | |
local kernel32 = ffi.load("kernel32") | |
-- Add C definitions to FFI for usage descriptions of components | |
ffi.cdef([[ | |
// Redefinitions for WinAPI conventions | |
typedef void VOID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local bytecodes = {} | |
local BC, run_function = {} | |
local VARG_CONST = {} | |
local lujlu_mt_funcs | |
local lujlu_cache = setmetatable({}, {__mode = "k"}) | |
local lujlu_identifier_mt = { | |
__tostring = function(self) | |
return tostring(lujlu_cache[self].data) | |
end, |
NewerOlder