Skip to content

Instantly share code, notes, and snippets.

View andrewgazelka's full-sized avatar
🤖

Andrew Gazelka andrewgazelka

🤖
  • USA
  • 13:41 (UTC -04:00)
View GitHub Profile
/* EDIT MODE */
.HyperMD-header.HyperMD-header-1 {
/* text-align: center !important; */
}
/* PREVIEW MODE */
/* .markdown-preview-view h1, h2, h3, h4, h5 { */
/* text-align: center !important; */
@andrewgazelka
andrewgazelka / rp.zsh
Created June 29, 2023 14:08
Run commands in parallel
# run in parallel
rp() {
name=$(getuuid)
tmux new-session -d -s $name
# Get the total number of items.
total=${#items[@]}
# Initialize a counter.
count=1
from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F
#Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
token_embeddings = model_output[0] #First element of model_output contains all token embeddings
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
match res {
Ok(res) => { ... }
Err(Io(io)) => { ... }
Err(InvalidArgs) => { ... }
}
set ideajoin
set multiple-cursors
set commentary
set vim-paragraph-motion
set surround
set argtextobj
set NERDTree
set textobj-entire
set clipboard+=unnamed
set hlsearch
@andrewgazelka
andrewgazelka / init.sh
Last active October 21, 2021 23:39
Branch creation based on issue name
# git create branch based on an issue (git checkout -b)
# example `gcob 118` creates a new branch based on issue 118
gcob(){
local issue_name="$(hub issue show $1 | head -n 1 | sed 's/# \([A-Za-z]*\)/\1/' | sed 's/ /-/g')"
local branch_name="$1-$issue_name"
git checkout -b $branch_name
}
@andrewgazelka
andrewgazelka / 📊 Weekly development breakdown
Last active May 30, 2021 01:09
Weekly development breakdown
Rust 19 hrs 52 mins █████████████░░░░░░░░ 62.1%
Dart 6 hrs 57 mins ████▌░░░░░░░░░░░░░░░░ 21.7%
TypeScript 1 hr 19 mins ▊░░░░░░░░░░░░░░░░░░░░ 4.2%
Java 1 hr 1 min ▋░░░░░░░░░░░░░░░░░░░░ 3.2%
JavaScript 50 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.6%

Contact

  • EMAIL: andrew (dot) gazelka (at) gmail.com
  • DISCORD: Andrew Gazelka#5386
@andrewgazelka
andrewgazelka / REPOSITORIES.md
Last active January 6, 2021 20:54
Cool Repositories
@andrewgazelka
andrewgazelka / app.module.ts
Created December 24, 2019 17:50
angular_search_autosuggest
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { SearchComponent } from './search/search.component';
import { SearchService } from './search/search.service';
@NgModule({
declarations: [
AppComponent,
SearchComponent