Skip to content

Instantly share code, notes, and snippets.

View acallaghan's full-sized avatar
🎖️
Probably procrastinating

Andy Callaghan acallaghan

🎖️
Probably procrastinating
View GitHub Profile
@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active July 4, 2025 09:59
Install mysql2 on MacOS Mojave

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@JasonTrue
JasonTrue / searchkick_and_elasticsearch_guidance.md
Last active March 11, 2025 03:37
Searchkick and Elastic Search guidance

Resources:

https://github.com/ankane/searchkick

Indexing

By default, simply adding the call 'searchkick' to a model will do an unclever indexing of all fields (but not has_many or belongs_to attributes).

In practice, you'll need to customize what gets indexed. This is done by defining a method on your model called search_data

def search_data

@tokland
tokland / puppeteer-click-by-text.js
Last active August 11, 2023 03:48
Click link by text in Puppeteer
const puppeteer = require('puppeteer');
const escapeXpathString = str => {
const splitedQuotes = str.replace(/'/g, `', "'", '`);
return `concat('${splitedQuotes}', '')`;
};
const clickByText = async (page, text) => {
const escapedText = escapeXpathString(text);
const linkHandlers = await page.$x(`//a[contains(text(), ${escapedText})]`);
anonymous
anonymous / config.json
Created September 10, 2014 17:02
Bootstrap Customizer Config
{
"vars": {
"@gray-darker": "lighten(#151D26, 13.5%)",
"@gray-dark": "lighten(#151D26, 20%)",
"@gray": "lighten(#151D26, 33.5%)",
"@gray-light": "lighten(#151D26, 46.7%)",
"@gray-lighter": "lighten(#151D26, 93.5%)",
"@brand-primary": "#685C79",
"@brand-success": "#5cb85c",
"@brand-info": "#FFBC67",
@beef
beef / Gemfile
Created December 15, 2010 11:29
Production environment for Rails 3 on heroku with rack-cache
# Add this to your gem file
group :production do
gem 'dalli'
gem 'rack-cache', :require => 'rack/cache'
gem 'rack-contrib', :require => 'rack/contrib'
end