Skip to content

Instantly share code, notes, and snippets.

@Hemantr05
Hemantr05 / transformer_block.py
Created September 1, 2021 12:13
Pytorch implementation of a transformer block with self-attention
class SelfAttention(nn.Module):
def __init__(self, k, heads=8):
super().__init__(self, SelfAttention)
self.k, self.heads = k, heads
self.tokeys = nn.Linear(k, k*heads, bias=False)
self.toqueries = nn.Linear(k, k*heads, bias=False)
self.tovalues = nn.Linear(k, k*heads, bias=False)
self.unifyheads = nn.Linear(heads*k, k)
def forward(self, x):
b, t, k = x.size()
@davidfowl
davidfowl / dotnetlayout.md
Last active April 10, 2025 05:11
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@fstorr
fstorr / how-to-get-speech-output-as-text-from-screen-readers.md
Last active April 10, 2025 05:08
How to get speech output as text from screen readers

How to get speech output as text from screen readers

Sometimes you need text, rather than voice, output from screen readers. Why? It's really useful for bug reports ("this disclosure icon is announced as 'black dash triangle dash filled dash x2 underscore final dot png' and needs alt text"). Luckily, getting this text is easy to do.

VoiceOver on MacOS

In VoiceOver you press Option + Control + Shift + C to have the last item that was announced copied to the clipboard. Bonus feature: pressing Option + Control + Shift + Z to save the last phrase to the desktop as an audio file.

VoiceOver on iOS

A three-finger quadruple tap copies the last announcement to the clipboard.

@one-more
one-more / store.ts
Last active April 10, 2025 05:08
subscribe to (redux)store with selector
export function subscribeWithSelector(selector: Function, cb: Function): Unsubscribe {
let prevValue = selector(
store.getState()
);
return store.subscribe(() => {
const newValue = selector(
store.getState()
);
if (newValue != prevValue) {
prevValue = newValue;
@Prakash4844
Prakash4844 / How to Setup endeavourOS for Gaming.md
Last active April 10, 2025 05:08
how to set up EndeavourOS for gaming on Linux.

How to set up EndeavourOS for gaming on Linux.

EndeavourOS

EndeavourOS styles itself as Terminal-centric Arch based Linux distribution, which means that you will be expected to use the Terminal for installation of everything from drivers, software, and kernels.

Step 1. Update The System.

Since EndeavourOS is classed as a rolling release distribution, this does mean that your system will be frequently updated, and from a gaming perspective, this will give you access to drivers and bug fixes faster than other distributions such as Ubuntu.

@parrot409
parrot409 / writeup.md
Last active April 10, 2025 05:08
CVE-2025-3155 writeup - Affecting Ubuntu distros

Details

Intro

CVE-2025-3155 affects Yelp which is The Gnome's user help application. It's installed by default on Ubuntu desktop.

what is a scheme

A URI scheme is the part of a Uniform Resource Identifier (URI) that identifies a protocol or a specific application (steam://run/1337) that should handle the resource identified by the URI. It's the part that comes before the colon (://).

@cld4h
cld4h / README.md
Last active April 10, 2025 04:59
Bypass the GFW; clash fake-ip and tproxy; iptables and transparent proxy on Linux; 在Linux上通过 iptables 以及 clash 配置透明代理用于本机及局域网翻墙网关; Linux 翻墙路由器配置

This article show you the ultimate way to set up a transparent proxy on Linux using clash and iptables to bypass the GFW in China.

We use:

You can go to github gist to download all files mentioned in this article.

@discatte
discatte / wince_hpc_links.md
Last active April 10, 2025 04:58
Windows CE Handheld PC HPC Software Links
@maczniak
maczniak / gist:98a7e56bca0427b38089
Last active April 10, 2025 04:58
Personal Project Ideas
  • open world game (like GTA, Open Government and Open Data, LARP like Mind's Eye Theatre, Perplex City, Infinite Challenge, CSI episode, location-based AR, mobile, user participation, WeareData, Watch Dogs, The Division, Localscope app, agent-based behavior, microeconomic simulation)
  • subway project (+Digital Shadow)
  • semantic web editor in browser (Atom)
  • Korea history-themed strategy game
  • board/card game maker (with machine learning)
  • usenet-based bulletin board with many kinds of client interfaces
  • open source Splunk (data analytics & visualization, see Zeppelin)
  • Java profiler
  • HWP file format parser (as Tika filter)
  • Internet portal movie rating analysis
@imba-tjd
imba-tjd / .Cloud.md
Last active April 10, 2025 04:56
☁️ 一些免费的云资源

  • IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装。PaaS提供语言环境和框架(可以自己选)。SaaS只能使用开发好的软件(卖软件本身,如税务会计、表格文字处理)。BaaS一般类似于非关系数据库,但各家不通用
  • 云服务的特点:零前期成本 & 按需付费 & 弹性(类似于租,可随时多加、退掉;但没有残值)、高可用(放在机房中,不同AZ间水电隔离)

其他人的集合