Skip to content

Instantly share code, notes, and snippets.

View qbilius's full-sized avatar

Jonas Kubilius qbilius

View GitHub Profile
@qbilius
qbilius / lang-dot.m
Created January 19, 2024 07:06
Color indicator of an input source in MacOS
// Color indicator of an input source in MacOS
// Shows a dot at the top right corner that changes color depending on the current input source.
// By default, it is set to show a green dot for the US keyboard layout and a red one for anything else.
// You can show or hide it by pressing Cmd+Opt+Ctrl+Shift.
// Why would one need such an indicator?
// In order to have more screen space, I keep my menu bar hidden and only show up when I move mouse to the top of the screen.
// Thus, I cannot see which input source is currently selected and often I find myself typing in non-US symbols
@qbilius
qbilius / minimal.py
Last active November 30, 2022 20:38
Minimal PyTorch test script
import torch
from torch import nn
import tqdm
class Model(nn.Module):
def __init__(self):
super().__init__()
self.w = nn.Parameter(torch.tensor(1.))
@qbilius
qbilius / README.md
Created February 5, 2019 09:17
Circle vs ellipse classification

Get the weights from here

To run the test:

`python circle_vs_ellipse.py circle_vs_ellipse --n_train 100 --n_test 100 --restore_path cornet_z_epoch25.pth.tar - -j 4 --batch_size 100

@qbilius
qbilius / ipynb_toc
Created August 12, 2014 06:18
Simple TOC generator for IPython Notebooks
import json
with open('mynotebook.ipynb', 'r') as f:
with open('contents.md', 'w') as out:
nb = json.load(f)
for cell in nb['worksheets'][0]['cells']:
if cell['cell_type'] == 'heading':
pad = (cell['level'] - 1) * 2
link = cell['source'][0].replace(' ', '-')
link = link.replace('(', '%28').replace(')', '%29')
text = '- [%s](#%s)' % (cell['source'][0], link)
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.