Skip to content

Instantly share code, notes, and snippets.

@suryakun
suryakun / install_elixir.md
Created June 7, 2018 22:00 — forked from rubencaro/install_elixir.md
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.

@suryakun
suryakun / error android licence flutter.txt
Last active October 17, 2018 16:44
Install Flutter : ✗ Android license status unknown.
flutter doctor --android-licenses
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
/home/surya/Android/Sdk/tools/bin/sdkmanager --update
flutter doctor --android-licenses
Y
git remote rm origin
git remote add origin https://[APPLICATION]:[NEW TOKEN]@github.com/[ORGANISATION]/[REPO].git
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
@suryakun
suryakun / simple-terraform-ec2-setup
Created October 10, 2021 15:30
Simple Terraform EC2 setup
provider "aws" {
region = "ap-southeast-1"
}
variable "ingress" {
type = list(number)
default = [80, 433, 22]
}
variable "egress" {
@suryakun
suryakun / simple-map-reduce.ts
Created February 7, 2023 10:56
Simple map reduce
const arr : String[] = ["B$u$i$ld", "$t$$h$e", "N$e$x$t", "E$$ra", "$$o$f$", "S$$of$t$wa$r$e", "De$$ve$l$op$me$n$t"];
function buildTheSentence(arr: String[]) : String {
const result: String = arr
.map((str: String) => (str.match(/[a-zA-Z]/gm) || []).join(''))
.reduce((sentence: String, word : String) => sentence + " " + word )
return result;
}
console.log(buildTheSentence(arr))
@suryakun
suryakun / gist:99b9f278daa4e594ef064dc6b8bf9be0
Created July 7, 2024 17:56
Sample of import pdf data with langchain
import 'dotenv/config'
import 'pdf-parse'
import { z } from 'zod'
import { MemoryVectorStore } from 'langchain/vectorstores/memory';
import { createStuffDocumentsChain } from 'langchain/chains/combine_documents';
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';
import { PDFLoader } from '@langchain/community/document_loaders/fs/pdf';
import { createRetrievalChain } from 'langchain/chains/retrieval';
import { ChatPromptTemplate } from "@langchain/core/prompts";
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";