Skip to content

Instantly share code, notes, and snippets.

View oddrationale's full-sized avatar

Dariel Dato-on oddrationale

View GitHub Profile
@oddrationale
oddrationale / langchain-conversationalretrievalchain-with-memory.ipynb
Created April 14, 2023 06:03
LangChain-ConversationalRetrievalChain-with-Memory.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oddrationale
oddrationale / Config.ini
Created October 11, 2020 21:29
bug.n Config
; bug.n - tiling window management
; @version 9.0.2
;; Status bar
;Config_showBar=1
Config_horizontalBarPos=-350
Config_verticalBarPos=tray
Config_barWidth=280
Config_singleRowBar=0
;Config_spaciousBar=0
@oddrationale
oddrationale / search_images_bing.md
Created September 6, 2020 01:27
Download more than 150 images using Bing Search API

HOWTO:Download more than 150 images using Bing Search API

From this post on the fastai forums, we discussed the best way to get more than 150 images from the Bing Search API. We came up with a solution to modify the utils.py as follows:

# +
# pip install azure-cognitiveservices-search-imagesearch

import logging
(function(e, s) {
e.src = s;
e.onload = function() {
jQuery.noConflict();
jQuery('<style type="text/css"> .remove { opacity:0.3;}\n .urlmodal {padding: 10px; background-color: #eee; position: fixed; bottom: 0; right: 0; height: 200px; width: 300px; z-index: 1000;} .urlmodal textarea {width: 100%; height: 140px;}</style>').appendTo('head');
jQuery('<div class="urlmodal"><h3>Let\'s create a dataset</h3><textarea>Scoll all the way down\nClick "Show more images"\nScroll more\nClick on the images you want to remove from the dataset\nThe urls will appear in this box for you to copy.</textarea></div>').appendTo('body');
jQuery('.urlmodal textarea').focus(function() {updateUrls(); setTimeout(selectText, 100)}).mouseup(function() {return false;});
jQuery(window).scroll(function() {
toggle();
updateUrls();
@oddrationale
oddrationale / scrapeImageUrls.js
Last active March 15, 2020 02:04
Scrape image urls
// Google Images
var urls=Array.from(document.querySelectorAll(".rg_i")).map(el=>el.hasAttribute("data-src")?el.getAttribute("data-src"):el.getAttribute("data-iurl")).filter(l=>l!=null).join("\n");
var a = document.createElement("a");a.download = "filename.txt";a.href = "data:text/csv;charset=utf-8,"+urls;a.click();
// DuckDuckGo Images (uses Bing)
var urls=Array.from(document.querySelectorAll(".tile--img__img")).map(el=>el.hasAttribute("data-src")?el.getAttribute("src"):el.getAttribute("data-src")).filter(l=>l!=null).map(l=>"https:"+l).join("\n");
var a = document.createElement("a");a.download = "filename.txt";a.href = "data:text/csv;charset=utf-8,"+urls;a.click();
// Bing Images
var urls=Array.from(document.querySelectorAll(".mimg")).map(el=>el.hasAttribute("src")?el.getAttribute("src"):null).filter(l=>l!=null&&l.startsWith("http")).join("\n");
@oddrationale
oddrationale / KittySolarizedDark
Created January 25, 2018 18:10
Kitty Solarized Dark Color Scheme
Colour0\131,148,150\
Colour1\147,161,161\
Colour2\0,43,54\
Colour3\7,54,66\
Colour4\0,43,54\
Colour5\238,232,213\
Colour6\7,54,66\
Colour7\0,43,54\
Colour8\220,50,47\
Colour9\203,75,22\

Easiest way to install nodejs on Ubuntu

Installs the latest version of nodejs/iojs

curl https://raw.githubusercontent.com/isaacs/nave/master/nave.sh | sudo bash -s -- usemain latest

No need to add PPA repo.