[Unit]
Description=Slice with MemoryLimit of 80% for docker
Before=slices.target
[Slice]
MemoryAccounting=true
MemoryMax=10%
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
function gh_logs() { | |
#needs fzf, jq, github cli | |
branch_name=${1:-} | |
repo_name= | |
if [[ -n $2 ]]; then | |
repo_name="-R$2" | |
fi | |
job_name=$(gh $repo_name pr checks $branch_name|fzf|cut -d$'\t' -f1) | |
run_id=$(gh $repo_name pr checks $branch_name|grep "$job_name"|cut -d'/' -f8) | |
echo run id: $run_id |
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
[ | |
{ | |
"arguments": [ | |
"/usr/bin/gcc", | |
"-c", | |
"-Wsign-compare", | |
"-Wunreachable-code", | |
"-DNDEBUG", | |
"-g", | |
"-fwrapv", |
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 data index on date | |
# time series data like credit card transactions for example | |
df = pd.read_csv('~/Downloads/time_series_data.csv', index_col='Date', parse_dates=True) | |
# group by apply data and sum | |
df2 = df.groupby(pd.Grouper(freq='Y')).sum() | |
#df2 now contains sumarized data | |
# show perenctiles for example | |
df2.quantile([0.1, 0.5, 0.8, 0.9, 0.95]) |
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
from http.server import HTTPServer, SimpleHTTPRequestHandler, test | |
import sys | |
class CORSRequestHandler (SimpleHTTPRequestHandler): | |
def _send_cors_headers(self): | |
self.send_header("Access-Control-Allow-Origin", "*") | |
self.send_header("Access-Control-Allow-Methods", "GET,POST,OPTIONS") | |
def end_headers (self): |
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
python -c "import sysconfig; print('-fprofile-use' in (sysconfig.get_config_var('PY_CFLAGS') + sysconfig.get_config_var('PY_CFLAGS_NODIST')))" |
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
call plug#begin() | |
Plug 'neovim/nvim-lspconfig' | |
Plug 'nvim-lua/plenary.nvim' | |
Plug 'nvim-telescope/telescope.nvim' | |
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} | |
Plug 'nvim-treesitter/playground' | |
Plug 'hrsh7th/nvim-compe' | |
Plug 'tjdevries/colorbuddy.vim' | |
Plug 'tjdevries/gruvbuddy.nvim' | |
call plug#end() |
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
out = Pipe() | |
p = run(pipeline(`top`, stdout=out), wait=false) | |
## Now p is running in the background | |
## You can read out | |
output = String(read(out, 1024)) ## read() reads until eof, which is not what I need. | |
line = readline(out) | |
kill(p) |
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 sys | |
import time | |
from enum import Enum | |
class Decorations(Enum): | |
reset = u'\u001b[0m' | |
red = u'\u001b[31m' | |
bold = u'\u001b[1m' | |
green = u'\u001b[32m' |
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
# Statistics on eng positions in Seattle | |
Data coming from https://www.levels.fyi/js/salaryData.json | |
basesalary totalyearlycompensation yearsofexperience | |
count 1224.000000 1325.000000 1325.000000 | |
mean 172.752042 324.453585 10.964151 | |
std 32.179319 140.238469 2.373705 | |
min 90.000000 100.000000 8.000000 | |
25% 153.000000 226.000000 9.000000 |
NewerOlder