Skip to content

Instantly share code, notes, and snippets.

View submit.py
import requests
name = 'tfidf_benchmark'
contest = 'marco-search'
fpath = 'output'
files = {"upload": open(fpath, 'rb')}
url = 'https://models.clapresearch.com/api/submit'
requests.post(url, data={"user": name, "contest": contest},
@theSage21
theSage21 / sc.bash
Created Jul 10, 2018
Vim + Covim + python 3
View sc.bash
sudo apt install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \
python3-dev ruby-dev lua5.1 liblua5.1-dev libperl-dev git
sudo apt remove vim vim-runtime gvim
git clone https://github.com/vim/vim.git
cd vim/src
View a_rainforest_in_ml.md

title: A Rainforest in Machine Learning author: Arjoonn Sharma @ CLAP Research patat: incrementalLists: true ...

gg

@theSage21
theSage21 / mailer.py
Last active Jan 4, 2022
Sending Files to My Kindle From Arxiv
View mailer.py
# encoding: utf-8
# Install: pipenv install requests bs4 --python 3
# Usage: python mailer.py https://arxiv.org/abs/1805.12076
# Always supply an arxiv ABS page!!!
import sys
import os
import smtplib
import requests
@theSage21
theSage21 / goldrush.py
Last active May 30, 2018
High load simulator based on aiohttp
View goldrush.py
import aiohttp
import asyncio
import async_timeout
from tqdm import tqdm
TIMEOUT_LIMIT = 50
async def _get(url, json, pbar):
async with aiohttp.ClientSession() as session:
for _ in range(100):
View trainer.py
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
import os
from __future__ import print_function
import keras
View bulker.py
import asyncio
import aiohttp
import async_timeout
headers = {}
links = [] # TODO: Populate this somehow with urls
done = asyncio.Queue()
View dashboard.yml
dashboard "Food":
- h1 text: Food
- h2 text: By caloric content
- 2 columns:
- attr:query: '[to_entries | .[] | {"component": "rows", "data": [
{"component": "text", "args": {"tagName": "h3"}, "data": .key},
{"component": "chart", "args": {"type": "line"}, "data": {"columns": .value}}
]}]'
- data: https://gist.githubusercontent.com/theSage21/9ca3a5b55ec324599d1baea229c19e27/raw/e81c3109a2c72ad5d718f18e846d6044022e91d7/data.json
View dash.yml
dashboard "Food":
- h1 text: Food
- h2 text: By caloric content
- 3 columns:
- attr:query: '[to_entries | .[] | {"component": "rows", "data": [
{"component": "text", "args": {"tagName": "h3"}, "data": .key},
{"component": "chart", "args": {"type": "pie"}, "data": {"columns": .value}}
]}]'
- data: https://gist.githubusercontent.com/theSage21/9ca3a5b55ec324599d1baea229c19e27/raw/bd8fb11a93f7607265c38daf273184dcd0b8a83e/data.json
View data.json
{
"Bananas": [1,2,3, 4, 5],
"Tofu" : [1, 1.5, 3],
}