Skip to content

Instantly share code, notes, and snippets.

View covard's full-sized avatar
💾

Curtis Ovard covard

💾
  • Salt Lake City, Utah
View GitHub Profile
@covard
covard / ffi_gem_error.md
Last active October 22, 2021 14:03
Installing the ffi gem will sometimes cause an error below is the error I have run into and how to solve it. Bundle config set. Credit due https://stackoverflow.com/questions/64098041/cant-install-ffi-v-1-9-18-on-macos-catalina

ffi gem install error

error: implicit declaration

$ gem install ffi
.
.
.
error: implicit declaration of function 'rb_thread_call_without_gvl' is invalid
@covard
covard / bundler_fix.md
Last active March 10, 2021 23:00
Fixing Bundler multiple / single default

Default Bundler

remove it first

$ gem info bundler

if you have an older version listed as default, older than what is being asked for try removing the default (you will need to change the file path based on the version

@covard
covard / icu4c.md
Created July 23, 2020 22:25
ic4uc issues with node, node 10 requiring ic4uc v64
@covard
covard / vi_remove_blank_lines.md
Created July 21, 2020 18:09
VI remove blank lines and whitespace.

Use either of the following commands to delete all empty lines:

:g/^$/d
:v/./d

If you want to delete all lines that are empty or that contain only whitespace characters (spaces, tabs), use either of:

@covard
covard / gist:4b5509296f95c403658c998540d60759
Created May 21, 2020 21:52 — forked from ramonsmits/gist:7563502
Example of Mandrill webhook JSON data.
[
{
"event": "send",
"msg": {
"ts": 1365109999,
"subject": "This an example webhook message",
"email": "[email protected]",
"sender": "[email protected]",
"tags": [
"webhook-example"
@covard
covard / prune_mysql_bin_logs.md
Last active July 7, 2020 22:17
Pruning mysql bin logs 😐 I had gigs and gigs of bin logs.

Examine the binary logs to decide up to where you want to delete to:

$ ls -la /usr/local/var/mysql
-rw-rw----  1 mysql mysql   104871967 Aug 24 00:01 BINLOG.015687
-rw-rw----  1 mysql mysql   104885618 Aug 24 00:04 BINLOG.015688
-rw-rw---- 1 mysql mysql 104866713 Aug 24 00:06 BINLOG.015689
@covard
covard / macOS_boot_chime.md
Created March 23, 2020 17:35
macOS boot chime

to re-enable boot chime

$ sudo nvram BootAudio=%01

to disable boot chime

$ sudo nvram BootAudio=%00

@covard
covard / update_bash_macos.md
Last active May 12, 2022 20:41
Update / Install newer bash on macOS. Catalina moves to zsh

Check your version

$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.

Install newer from homebrew

require 'tabulo'
require 'rainbow'
Rails.application.eager_load!
unused_routes = {}
# Iterating over all non-empty routes from RouteSet
Rails.application.routes.routes.map(&:requirements).reject(&:empty?).each do |route|
name = route[:controller].camelcase
next if name.start_with?("Rails")
@covard
covard / nokogiri_install
Created July 11, 2019 21:26 — forked from sobstel/nokogiri_install
nokogiri -> ERROR: cannot discover where libxml2 is located on your system
# `ERROR: Error installing nokogiri:
# ERROR: Failed to build gem native extension.
#
# current directory: /usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0/ext/nokogiri
# /usr/local/var/rbenv/versions/2.3.1/bin/ruby -r ./siteconf20170103-68488-r71c9j.rb extconf.rb --with-xml=/usr/local/Cellar/libxml2/ --use-system-libraries
# checking if the C compiler accepts ... yes
# checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
# Building nokogiri using system libraries.
# ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed.
# *** extconf.rb failed ***