- EMAIL: andrew (dot) gazelka (at) gmail.com
- DISCORD: Andrew Gazelka#5386
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match res { | |
Ok(res) => { ... } | |
Err(Io(io)) => { ... } | |
Err(InvalidArgs) => { ... } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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% |
- until-destroy unsubscribes from observables on component destroy
- ng-stack-forms
- ng-select select/search util input
- ngx-mask masks for inputs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder