Skip to content

Instantly share code, notes, and snippets.

View tochman's full-sized avatar
💭
Coding on my own SaaS project (Rails + React)

Thomas Ochman tochman

💭
Coding on my own SaaS project (Rails + React)
View GitHub Profile
@tochman
tochman / README.md
Created December 8, 2023 14:11 — forked from horosin/README.md
Extracting and Generating JSON Data with GPTs, LangChain, and Node.js
@tochman
tochman / factory_girl_strategy_find_or_create.rb
Created December 17, 2019 11:07 — forked from hiasinho/factory_girl_strategy_find_or_create.rb
FactoryGirl strategy for adding find & find_or_create
## http://stackoverflow.com/questions/7145256
module FactoryBot
module Strategy
class Find
def association(runner)
runner.run
end
def result(evaluation)
build_class(evaluation).where(get_overrides(evaluation)).first
@tochman
tochman / bullshit.js
Created November 25, 2019 21:11 — forked from raydog/bullshit.js
Bullshit as a Service
var E_PREFIX_RATE = 0.25;
// All of our word lists:
var _word_lists = {
verb : [
"implement", "utilize", "integrate", "streamline", "optimize", "evolve", "transform", "embrace",
"enable", "orchestrate", "leverage", "reinvent", "aggregate", "architect", "enhance", "incentivize",
"morph", "empower", "envisioneer", "monetize", "harness", "facilitate", "seize", "disintermediate",
@tochman
tochman / es-semaphore.sh
Last active November 24, 2019 22:34 — forked from jtadeulopes/es-semaphore.sh
A script for installing ES on SemaphoreCI
#! /usr/bin/env bash
## Usage:
## wget https://gist.githubusercontent.com/jtadeulopes/ae1f1ffe53000012b27b1112aecaa4b7/raw/45f792729d8b26e42f07028d0693e4de51024383/es-semaphore.sh && bash es-semaphore.sh <es-version>
##
ES_HOST="0.0.0.0"
ES_PORT="9200"
ES_VERSION=${1:-'5.0.0'}
DEB='elasticsearch-'"$ES_VERSION"'-amd64.deb'
@tochman
tochman / prawn_wrapped.rb
Created November 23, 2019 15:15 — forked from jlsync/prawn_wrapped.rb
How to prevent prawn wrap_by_char? charred.pdf
#!/usr/bin/env ruby
require 'rubygems'
require 'prawn'
@pdf = Prawn::Document.new
x = 0
texts = [ "alexander", "the alexander", "the alexander building" ]
texts.each do |text|
@tochman
tochman / semaphore-es.sh
Last active May 29, 2018 18:49 — forked from BlackFoks/semaphore-es.sh
A script for installing ES on SemaphoreCI
#!/bin/bash
# Install a custom ElasticSearch version - https://www.elastic.co/products/elasticsearch
#
# To run this script on SemaphoreCI, add the following command to your project's build setup:
# \curl -sSL <RAW_URL_FOR_THIS_SCRIPT> | bash -s
#
ELASTICSEARCH_VERSION="6.2.4"
ELASTICSEARCH_PORT="9250"
ELASTICSEARCH_DIR="$SEMAPHORE_PROJECT_DIR/elasticsearch"
ELASTICSEARCH_WAIT_TIME="15"
@tochman
tochman / index.html.erb
Created January 24, 2017 10:51
Capybara selectors with 'data-' attributes
<table>
<thead>
<tr>
<th>Name</th>
<th>Email></th>
<th>Country</th>
<th></th>
</tr>
</thead>
@tochman
tochman / Gemfile
Created July 6, 2016 09:46 — forked from eliotsykes/Gemfile
JavaScript testing in Rails 4.x with RSpec, Capybara, PhantomJS, Poltergeist
# Add poltergeist gem to Gemfile, in :test group,
# then run `bundle` to install
group :test do
...
gem 'poltergeist'
...
end
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems: