Skip to content

Instantly share code, notes, and snippets.

View shrikrishnaholla's full-sized avatar

Shrikrishna Holla shrikrishnaholla

View GitHub Profile
@staberas
staberas / interactive_websearch_chat.py
Last active March 23, 2024 15:21
interactive_websearch_chat.py
# This script requires to have some basic Python skills
# - Install python dependencies (thanks to TitwitMuffbiscuit on reddit) :
# pip install nltk beautifulsoup4 googlesearch-python trafilatura wolframalpha
#
# If you get this error "Resource punkt not found", it's because Punkt sentence tokenizer for Natural Language Toolkit is missing.
# Edit the file and add this before
# from nltk.tokenize import word_tokenize ,
# it will download the necessary english.pickle:
# import nltk
# nltk.download('punkt')
@tanaikech
tanaikech / submit.md
Last active July 26, 2020 02:27
Benchmark: Loop for Array Processing using Google Apps Script with V8

Benchmark: Loop for Array Processing using Google Apps Script with V8

- February 9, 2020 - Published. - March 15, 2020 - Results of "for of" and "for of with iterator" were added.

Various search databases and backends as alternatives to Elasticsearch.

Rust

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@Vovan-VE
Vovan-VE / fix-lists.js
Created June 20, 2019 00:09
Quill Lists Fix (redux ready)
/*
* Quill 1.* cannot next block elements inside <li> including nested <ul>,<ol>.
* To achieve nested lists it uses flat linear lists with CSS class `ql-indent-\d+` on <li>.
* Nesting <ul> inside <ol> or vice-versa cause topmost list to break in two adjacent lists.
*
* There is the only solution: fix bad HTML after getting it from Quill and break it back before
* passing to Quill again for editing.
*/
const mkNode = (tagName = 'div') => document.createElement(tagName);
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
"""
Pull movie metadata from the https://www.themoviedb.org API.
Requires an API key stored in a .config file
The code is currently restricted to the movie category. To get it to run with
other categories, update the constants
(CATEGORY_SPECIFIC_CALLS, JSON_COLUMNS, KEYS_TO_DROP)
and delete the movie specific section of the export_data() function.
@gurudeb
gurudeb / bootstrap-3-right-offset.css
Created August 11, 2016 18:35
Bootstrap 3 offset on right
.col-xs-offset-right-12 {
margin-right: 100%;
}
.col-xs-offset-right-11 {
margin-right: 91.66666667%;
}
.col-xs-offset-right-10 {
margin-right: 83.33333333%;
}
.col-xs-offset-right-9 {
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@m-ou-se
m-ou-se / replace-debian-with-arch.txt
Last active October 22, 2023 12:16
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz'
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1