Skip to content

Instantly share code, notes, and snippets.

View robvolk's full-sized avatar

Rob Volk robvolk

View GitHub Profile
@robvolk
robvolk / n_grams_code_challenge.md
Last active March 30, 2022 01:18
N-Grams Code Challenge

Foxbox Digital N-Grams Code Challenge

This is a small programming problem to test your technical ability and coding style.

Instructions

Write a simple script to generate a set of n-grams from a string of text. N-grams are a contiguous sequence of n words from a string of text, and have many applications from full-text search indexes to machine learning.

You'll generate a set of every permutation of contiguous n-grams from a string of text, from 1-gram to n-grams where n is the number of words in the string

Example

@robvolk
robvolk / example.rb
Last active August 29, 2015 14:21
Perform Sidekiq jobs async on any queue!
class HackTheWorld
include Sidekiq::Worker
include Sidekiq::AnyQueue
def perform(arg1, arg2)
// ...
end
end
HackTheWorld.perform_async_on_queue(:fast, "arg1", "arg2")
@robvolk
robvolk / Preferences.sublime
Last active September 2, 2015 21:07
Sublime Text Developer Settings
{
"caret_extra_width": 1,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/SpaceCadet.tmTheme",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"font_size": 15,
"highlight_line": true,
"ignored_packages":
[
@robvolk
robvolk / application.js
Created August 15, 2013 22:02
AJAX Forms in Rails => Here are the basic components of building an automagic AJAX form with Ruby on Rails. Rails takes care of the plumbing of submitting the data for you, but leaves the UI logic entirely up to you. Just hook into the Rails' AJAX JavaScript events to control the UI logic.
// load Ruby on Rails unobtrusive scripting adapter for jQuery
// handles AJAX forms and client-side validation
//= require jquery_ujs