I hereby claim:
- I am obahareth on github.
- I am obahareth (https://keybase.io/obahareth) on keybase.
- I have a public key whose fingerprint is CAB8 5952 5444 8B43 F4F2 0615 BFFD 1B8F 549C C61D
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| # | |
| # Delete all objects matching a query | |
| # | |
| # @param query the query string | |
| # @param params the optional query parameters | |
| # | |
| def delete_by_query(query, params = nil) | |
| raise ArgumentError.new('query cannot be nil, use the `clear` method to wipe the entire index') if query.nil? && params.nil? | |
| params ||= {} | |
| params.delete(:hitsPerPage) |
You can play with the GraphQL API live here. It's pretty nice and has autocompletion based on the GraphQL schema.
The first example gets your first 3 starred repos, the cursor values can be used for pagination.
Here's an example response from the first query:
{| # Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile" | |
| gem 'jwt' |
| require "nokogiri" | |
| require "yomu" | |
| require "algoliasearch" | |
| def invalid_paragraph?(str) | |
| disallowed_strings = [ "", " ", "\n", " \n" ] | |
| disallowed_strings.include?(str) | |
| end | |
| def get_pdf_paragraphs(filename) |
I'm playing around with NER (Named Entity Recognition) and the basic idea is that I can pass in multiple paragraphs and get recognized entities in a nicely formatted dictionary of lists.
I might look into running the Java servelet that stanford made to increase performance.
{
'organizations': ['Wall', 'Street', 'Journal', 'Apple', 'Inc.', 'Apple', 'TV', 'Apple', 'Mac', 'App', 'Store', 'Apple', 'Computer', ',', 'Inc.', 'Apple', 'Inc.', 'National', 'Hockey', 'League', 'Montreal', 'Canadiens', 'Stanley', 'Cups', 'Toronto', 'Blue', 'Jays'],
'locations': ['France', 'Cupertino', 'California'],| require 'fileutils' | |
| require 'mini_magick' | |
| # Get all files of any type within the 4x folder, within any subdirectory | |
| sources = Dir.glob(File.join('**', '4x', '**', '*.png')) | |
| # Create our target directories, and the size factor for that directory | |
| target_directories = [ | |
| { name: '2x', size_factor: 0.5 }, | |
| { name: '1x', size_factor: 0.25 } |
| # Apparently Apple keeps system logs in this folder as .asl files. They're | |
| # loaded into terminal sessions and can slow things down when there's a lot of | |
| # them. | |
| # | |
| # Taken from: | |
| # https://ariejan.net/2011/11/08/fixing-a-slow-starting-terminal-or-iterm2-on-mac-os-x/ | |
| sudo rm /private/var/log/asl/*.asl |
| # Install Homebrew | |
| ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| brew doctor | |
| # Tap sources we need | |
| brew tap homebrew/dupes | |
| brew tap homebrew/versions | |
| brew tap homebrew/homebrew-php | |
| brew tap caskroom/versions |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |