Skip to content

Instantly share code, notes, and snippets.

View indexzero's full-sized avatar
🌎
Always bet on Open Source

Charlie Robbins indexzero

🌎
Always bet on Open Source
View GitHub Profile
# STEP 1: Load
# Load documents using LangChain's DocumentLoaders
# This is from https://langchain.readthedocs.io/en/latest/modules/document_loaders/examples/csv.html
from langchain.document_loaders.csv_loader import CSVLoader
loader = CSVLoader(file_path='./example_data/mlb_teams_2012.csv')
data = loader.load()
@harubaru
harubaru / wd1-3-release.md
Last active November 22, 2024 15:29
Official Release Notes for Waifu Diffusion 1.3
🌞 Morning 14 commits ▎░░░░░░░░░░░░░░░░░░░░ 1.6%
🌆 Daytime 374 commits ████████▉░░░░░░░░░░░░ 42.6%
🌃 Evening 451 commits ██████████▊░░░░░░░░░░ 51.4%
🌙 Night 39 commits ▉░░░░░░░░░░░░░░░░░░░░ 4.4%
@brycebaril
brycebaril / output.md
Last active February 23, 2020 22:35
process.nextTick vs setImmediate

@mafintosh asks: "Does anyone have a good code example of when to use setImmediate instead of nextTick?"

https://twitter.com/mafintosh/status/624590818125352960

The answer is "generally anywhere outside of core".

process.nextTick is barely asynchronous. Flow-wise it is asynchronous, but it will trigger before any other asynchronous events can (timers, io, etc.) and thus can starve the event loop.

In this script I show a starved event loop where I just synchronously block, use nextTick and setImmediate

@jed
jed / plaque.md
Last active August 29, 2015 14:15
BrooklynJS "Sweet 0x10" Commemorative Plaque

[UPDATE] WE SOLD 'EM ALL, RAISING $2,625 for SCRIPTED!

It took a few months, but our experiment of upcycling our unused tokens into fundraising keepsakes finally paid off! It accomplished a whole lot of win in one fell swoop:

  • Creating a physical commemoration of the awesomeness that has been the NYC JavaScript community over the past two years.
  • Raising $2,625 for [ScriptEd][], a NYC-based organization that does amazing work in the local tech community.
  • Increasing BrooklynJS ticket availability through reserved ticket bundling.
  • Letting me work on a creative physical project with my pals @brianloveswords, @kosamari, and @philduffy.
  • Taking bags and bags of unused tokens out of my tiny Brooklyn walkup closets.
@ericelliott
ericelliott / essential-javascript-links.md
Last active November 8, 2024 17:29
Essential JavaScript Links
@thefoxis
thefoxis / jsfest-slides.md
Last active September 22, 2015 23:24
Slides from JavaScript Fest individual events in Oakland, 7th-13th Dec, 2014.

Someone tried to exploit the Shellshock vulnerability in Bash on lodash.com, likely as part of a mass-exploit attempt.

In this case, the exploit attempted to download a modified version of @schierlm’s pseudo-terminal Perl script that would connect to 72.167.37.182 on port 23. The download URL contains the targeted host name (?h=lodash.com) which gives the attacker an indication of which hosts might have the /tmp/a.pl backdoor in place.

@othiym23
othiym23 / npm-upgrade-bleeding.sh
Created September 20, 2014 19:36
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@constantology
constantology / process.logger.js
Created July 24, 2014 09:39
using node's process to emit events to log stuff from anywhere
// use like this:
// process.emit( 'app:log', module, arg1, arg2, ..., argN );
var Module = require('module');
function logConsole(method, module) {
var args = [(new Date()).toJSON(), method];
var index = 1;
if (module instanceof Module) {