Skip to content

Instantly share code, notes, and snippets.

View RXminuS's full-sized avatar

Rik RXminuS

  • Sourcegraph
  • Sweden
  • 04:10 (UTC +02:00)
  • LinkedIn in/riknauta
View GitHub Profile
@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active April 5, 2025 02:20
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@HarshTrivedi
HarshTrivedi / pad_packed_demo.py
Last active April 17, 2025 01:26 — forked from Tushar-N/pad_packed_demo.py
Minimal tutorial on packing (pack_padded_sequence) and unpacking (pad_packed_sequence) sequences in pytorch.
import torch
from torch import LongTensor
from torch.nn import Embedding, LSTM
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium']
#
# Step 1: Construct Vocabulary
# Step 2: Load indexed data (list of instances, where each instance is list of character indices)
@Vartkat
Vartkat / buildresticexcludes.sh
Last active February 20, 2025 14:54
Bash script to build a restic exclude list that mimics Apple TimeMachine exclude list
#!/bin/bash
# This script intend to mimic TimeMachine exclude list.
# As the exclude list can evolve between backups it has to be rebuilt before every backup
# Apple uses 5 types of excludes, four from the /System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist file
# and files from applications where metadata says to not backup, these can be found usinf
# sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"
SYSLOG=/usr/bin/syslog;
TEMPFILE=$1;
@Felflare
Felflare / XLNet_span_selection_squad
Created February 10, 2020 03:03
XLNet Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`). Simple demo of loss and logits.
from transformers import XLNetTokenizer, XLNetForQuestionAnsweringSimple
import torch
tokenizer = XLNetTokenizer.from_pretrained('xlnet-base-cased')
model = XLNetForQuestionAnsweringSimple.from_pretrained('xlnet-base-cased')
input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True)).unsqueeze(0) # Batch size 1
print(f'Encoded sequence ids -- {input_ids.tolist()[0]}')
# Encoded sequence ids -- [17, 11368, 19, 94, 2288, 27, 10920, 4, 3]
start_positions = torch.tensor([1])
end_positions = torch.tensor([3])
@MichaelCurrin
MichaelCurrin / README.md
Last active April 6, 2025 18:23
GitHub GraphQL - Get files in a repository

Get GitHub Files

Get the metadata and content of all files in a given GitHub repo using the GraphQL API

You might want to get a tree summary of files in a repo without downloading the repo, or maybe you want to lookup the contents of a file again without download the whole repo.

The approach here is to query data from GitHub using the Github V4 GraphQL API.

About the query

import time
# Make sure you have duckdb==0.7.0. Earlier versions might fail with GIL problems ( https://twitter.com/mr_le_fox/status/1620535141675433986 )
import duckdb
import s3fs
from fsspec.implementations.cached import SimpleCacheFileSystem
# Create the s3 file system. This one does not have caching