Skip to content

Instantly share code, notes, and snippets.

@searls
searls / whereable.rb
Created September 4, 2021 16:06
The initial implementation of a Whereable query filter for KameSame.
class Whereable
def initialize(where:, model: Item, ranking_conditions: [], valid: true, data_source: nil)
@model = model
@where = where
@data_source = data_source
@ranking_conditions = ranking_conditions
@valid = valid
end
def valid?
@KonnorRogers
KonnorRogers / environment.js
Last active July 12, 2024 22:42
ESBuild with Webpacker < 6 in Rails. Bye Babel <3
// DONT FORGET TO `yarn add esbuild-loader` !!!
// config/webpacker/environment.js
const { environment } = require('@rails/webpacker')
const { ESBuildPlugin } = require('esbuild-loader')
const esBuildUse = [
{
loader: require.resolve('esbuild-loader'),
// What you want to compile to, in this case, ES7
@mihir-kumar-thakur
mihir-kumar-thakur / sphinx-binary-installation.md
Last active June 1, 2021 15:33
Sphinx search 3 installation with binary on Ubuntu for working with Thinking sphinx gem on ruby on rails

Sphinx search 3 installation with binary on Ubuntu for working with Thinking sphinx gem on ruby on rails

Download sphinx with curl

curl http://sphinxsearch.com/files/sphinx-3.3.1-b72d67b-linux-amd64.tar.gz -o sphinx.tar.gz

Unzip downloaded zip file

@aparrish
aparrish / spacy_intro.ipynb
Last active August 9, 2023 01:41
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TheWaWaR
TheWaWaR / gunicorn_service.py
Last active October 5, 2023 12:54
Gunicorn service script {Start | Restart | Stop | Reload | Quit}
#!/usr/bin/env python
#coding: utf-8
import os
import imp
import time
import signal
import argparse
import commands