Skip to content

Instantly share code, notes, and snippets.

View 5iDS's full-sized avatar
💭
@ease with the Source

Max 5iDS

💭
@ease with the Source
View GitHub Profile
@gautamborgohain
gautamborgohain / research_agent.py
Last active August 22, 2024 08:10
Simple script implementing a command line interface to run ReAct agent on PDFs and CSV using local LLM or OpenAI
"""
This script creates and interacts with ReActAgents for PDF and CSV data.
Dependencies (install in your virtual environment) :
python = "3.11.1"
llama-index-agent-openai = "^0.2.5"
openai = "^1.30.1"
pandas = "^2.2.2"
fitz = "^0.0.1.dev2"
@svpino
svpino / llama2.py
Last active January 25, 2024 13:12
Running a fine-tuned Llama 2 model
import torch
import peft
import transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
from huggingface_hub.hf_api import HfFolder
ACCESS_TOKEN = "ENTER YOUR HUGGINGFACE ACCESS TOKEN HERE"
HfFolder.save_token(ACCESS_TOKEN)
@usrflo
usrflo / certbot-cleanup.sh
Last active September 23, 2024 16:09
Remove outdated letsencrypt CSRs, keys and certificates from /etc/letsencrypt
#!/bin/bash
# Remove outdated letsencrypt CSRs, keys and certificates
lesslBasePath=/etc/letsencrypt
keepOldVersions=1
keepOldCsrDays=180
keepOldKeysDays=180
if [ ! -d "$lesslBasePath" ]; then
@nicolabeghin
nicolabeghin / docker.yml
Created March 30, 2021 18:28
Ansible to install docker and docker-compose on AWS Graviton t4a ARM64 instances
---
- name: Docker install
hosts: all
become: yes
tasks:
- name: Install docker-ce (centos) via amazon-linux-extras packages
shell: "amazon-linux-extras install docker -y"
- name: Install dependencies
yum:
@Drecu
Drecu / clean.js
Created February 17, 2021 10:05
Node script to delete folders and files recursively from the cli (usage: node clean.js path1 path2)
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-var-requires */
var fs = require('fs');
function deleteFolderRecursive(path) {
if(!fs.existsSync(path)) return console.log(`${path} does not exist!`)
if (fs.existsSync(path) && fs.lstatSync(path).isDirectory()) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
fs.readdirSync(path).forEach(function(file, _index){
var curPath = path + "/" + file;
@chriseugenerodriguez
chriseugenerodriguez / country-bounds.ts
Last active October 5, 2024 19:36
Google Map Country Bounds Javascript
import { Injectable } from '@angular/core';
@Injectable()
export class POIService {
// LEFT, BOTTOM, RIGHT, TOP
private country_bounding_boxes = [
{'AF': {'Afghanistan': [60.5284298033, 29.318572496, 75.1580277851, 38.4862816432]}},
{'AO': {'Angola': [11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998]}},
{'AL': {'Albania': [19.3044861183, 39.624997667, 21.0200403175, 42.6882473822]}},
{'AE': {'United Arab Emirates': [51.5795186705, 22.4969475367, 56.3968473651, 26.055464179]}},
@Bnaya
Bnaya / fetch-stream-json-parser.ts
Created April 9, 2019 08:24
fetch-stream-json-parser.ts basic code example
// https://github.com/dominictarr/JSONStream
// @ts-ignore
import JSONStream from "JSONStream";
import { Observable } from "rxjs";
class Bla {
public creativesOfChannelV4StreamEndpoint<T=any>(
channel: T,
brandId: string,
@hteumeuleu
hteumeuleu / darkModeHandler.ts
Last active March 30, 2023 14:00
Outlook.com darkModeHandler
import type { ContentHandler } from 'owa-controls-content-handler-base';
import { transformElementForDarkMode } from 'owa-dark-mode-utilities';
import {
ATTR_COLOR,
ATTR_BGCOLOR,
DATA_OG_STYLE_COLOR,
DATA_OG_ATTR_COLOR,
DATA_OG_STYLE_BACKGROUNDCOLOR,
DATA_OG_ATTR_BGCOLOR,
} from 'owa-content-colors-constants';
@TonSDe
TonSDe / ebextension-vhost.yaml
Created November 1, 2018 09:20
AWS Elastic Beanstalk : Enable .htaccess
files:
"/etc/httpd/conf.d/hello.conf":
mode: "000644"
owner: root
group: root
content: |
<VirtualHost *:80>
DocumentRoot /var/app/current
<Directory /var/app/current/>
Options Indexes FollowSymLinks
@ErikThiart
ErikThiart / php-nusoap.php
Created August 1, 2018 09:55
PHP7 nusoap library
<?php
/*
$Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $
NuSOAP - Web Services Toolkit for PHP
Copyright (c) 2002 NuSphere Corporation
This library is free software; you can redistribute it and/or