Skip to content

Instantly share code, notes, and snippets.

@IlyaGusev
IlyaGusev / train.py
Last active July 10, 2023 06:58
Generic Trasformer clf finetune
import argparse
import json
import random
import torch
from torch.utils.data import Dataset
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import Trainer, TrainingArguments
from tqdm import tqdm
@IlmariKu
IlmariKu / run.py
Last active June 4, 2021 11:15
run.py - Python command-line runner for repeated repository tasks
#!/usr/bin/env python3
import os
import datetime
import sys
import subprocess
"""
Command line tool to run simple commands from repository root
@avidale
avidale / pyahocorasick-entity-search.ipynb
Last active May 25, 2023 21:25
pyahocorasick entity search.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jarmitage
jarmitage / avril.tidal
Created April 14, 2020 20:37
Avril 14th
-- happy avril 14th :)))))))))))))))))))))))))))))))))))))))
do
let bars = 4
key = "8"
righthand = "[[4 -3] [0 _ _ _ _ _ 0]] [[-3, -8] [7 5 4 0]]"
lefthand = "[0 9 12 16] [4 12 16 19] [5 12 17 19] [2 12 17 16]"
d1 $ slow bars
$ stack [
n (righthand + key + "<24 36>/2"),
@bokenlin
bokenlin / Sonnet Native App Requirements.md
Created August 3, 2019 05:26
Requirements document for Sonnet native app

Sonnet One Native App Feature Requirements

Last updated Jul 31, 2019

This document is a high-level description of the various features currently present in the Sonnet One front-end web application and Cordova-wrapped native app that will be used to define requirements and an API for the React Native app.

Any features that we weren't able to implement in the Web environment but we plan to implement in the native app are marked with (unimplemented).

Introduction

@nillia
nillia / chrome-headless.service
Created March 7, 2018 21:21
Chrome headless (with debug in 9222) Systemd service
[Unit]
Description=Run an instance of Chrome headless with debug in 9222
[Service]
Type=simple
Restart=always
ProtectSystem=full
DynamicUser=true
ExecStart=/usr/bin/google-chrome --headless --disable-gpu --remote-debugging-port=9222
Environment=HOME=/tmp
@lukassup
lukassup / zipapp.md
Last active September 12, 2023 02:17
Python zipapp

Python zipapp web apps

What's a zipapp?

This concept is very much like .jar or .war archives in Java.

NOTE: The built .pyz zipapp can run on both Python 2 & 3 but you can only build .pyz zipapps with Python 3.5 or later.

Initial setup

@gdamjan
gdamjan / chrome-headless.service
Created September 13, 2017 18:28
headless chrome systemd service file
[Unit]
Description=headless chrome
[Service]
Type=simple
ProtectSystem=strict
DynamicUser=true
Environment=HOME=/tmp
ExecStart=/usr/bin/google-chrome --headless --disable-gpu --remote-debugging-port=9222
@vovimayhem
vovimayhem / docker-compose.yml
Created June 6, 2017 21:17
ELK stack example
version: "2"
volumes:
log-data:
driver: local
services:
elasticsearch:
image: elasticsearch:5.0
ports:
@yonglai
yonglai / headless_selenium_server_setup.sh
Created May 22, 2017 21:59
script to set up headless selenium in Ubuntu
#!/bin/sh
set -e
if [ -e /.installed ]; then
echo 'Already installed.'
else
echo ''
echo 'INSTALLING'
echo '----------'