Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🤷🏾‍♂️

antarr antarr

💭
🤷🏾‍♂️
View GitHub Profile
@antarr
antarr / Dockerfile
Created Dec 2, 2020
atbyrd/ruby:lastest
View Dockerfile
# Base off https://github.com/Azure-App-Service/ruby
FROM buildpack-deps:jessie-curl
LABEL maintainer="Antarr Byrds <antarr.byrd@gmail.com>"
RUN echo "deb http://deb.debian.org/debian/ jessie main" > /etc/apt/sources.list \
&& echo "deb-src http://deb.debian.org/debian/ jessie main" >> /etc/apt/sources.list \
&& echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \
&& echo "deb-src http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list \
&& echo "deb http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \
View data.json
[{\"id\":\"19228af7\",\"elType\":\"section\",\"settings\":[],\"elements\":[{\"id\":\"5b11ac1d\",\"elType\":\"column\",\"settings\":{\"_column_size\":100},\"elements\":[{\"id\":\"09917bd\",\"elType\":\"section\",\"settings\":{\"structure\":\"20\"},\"elements\":[{\"id\":\"2e1024f\",\"elType\":\"column\",\"settings\":{\"_column_size\":50,\"_inline_size\":null},\"elements\":[{\"id\":\"a605fc4\",\"elType\":\"widget\",\"settings\":{\"title\":\"Questions\"},\"elements\":[],\"widgetType\":\"heading\"}],\"isInner\":true},{\"id\":\"a8c2611\",\"elType\":\"column\",\"settings\":{\"_column_size\":50,\"_inline_size\":null},\"elements\":[{\"id\":\"e749f7d\",\"elType\":\"widget\",\"settings\":{\"title\":\"Key Takeaways\"},\"elements\":[],\"widgetType\":\"heading\"}],\"isInner\":true}],\"isInner\":true},{\"id\":\"24d81d3\",\"elType\":\"section\",\"settings\":{\"structure\":\"20\"},\"elements\":[{\"id\":\"bf69e59\",\"elType\":\"column\",\"settings\":{\"_column_size\":50,\"_inline_size\":null},\"elements\":[{\"id\":\"bfd9c58\",
@antarr
antarr / functions.php
Last active Jul 29, 2020
extend wpgraphql
View functions.php
add_action('graphql_register_types', function(){
register_graphql_field('Post', 'elementorData', [
'type' => 'String',
'description', __('Elementor Data JSON', 'wp-graphql'),
'resolve' => function($post) {
$data = get_post_meta($post->ID, '_elementor_data', true);
return !empty($data) ? $data : null;
}
]);
register_graphql_field('Page', 'elementorData', [
View functions.php
<?php
/**
* Astra functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Astra
* @since 1.0.0
*/
@antarr
antarr / ruby.sh
Created Apr 30, 2020
install ruby
View ruby.sh
# Install Ruby2.6 from Brightbox APT repository
config.vm.provision "shell", inline: <<-SHELL
apt-get -y install software-properties-common
apt-add-repository -y ppa:brightbox/ruby-ng
apt-get update
apt-get -y install ruby-switch ruby-bundler ruby2.3 ruby2.3-dev
sudo gem install bundler -v 1.16.6
SHELL
View gist:fa83abb2a79ad9ae7121954340607aee
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; font-src 'none' data: js.stripe.com;">
View install_ruby_via_rbenv.sh
sudo apt-get -y update
sudo apt-get -y install curl git-core python-software-properties ruby-dev libpq-dev build-essential nginx libsqlite3-0 libsqlite3-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
sudo -H -u vagrant bash -i -c 'rbenv install 2.6.5'
@antarr
antarr / Vagrantfile
Created Feb 28, 2020
migrate mysql to pg
View Vagrantfile
# frozen_string_literal: true
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/xenial64'
config.vm.network 'forwarded_port', guest: 80, host: 80, auto_correct: true
config.vm.network 'forwarded_port', guest: 443, host: 443, auto_correct: true
@antarr
antarr / expressions.rb
Created Feb 23, 2020
Replacement Regular Expressions
View expressions.rb
# replace double quotes with single quotes as well
# needs to be updated to exclude interopolated strings
=(\s)?["|'](.*)?["|]
=$1'$2
@antarr
antarr / console
Created Jan 14, 2020
authentication_spec
View console
{"dir_array":["./test/factories/reminder_triggers.rb","./test/factories/certificate_contents.rb","./test/factories/reseller_tiers.rb","./test/factories/csrs.rb","./test/factories/signed_certificates.rb","./test/factories/assignments.rb","./test/factories/cdns.rb","./test/factories/certificates.rb","./test/factories/certificate_orders.rb","./test/factories/billing_profiles.rb","./test/factories/sub_order_items.rb","./test/factories/roles.rb","./test/factories/users.rb","./test/factories/ssl_accounts.rb","./test/factories/product_variant_group.rb","./test/factories/product_variant_item.rb"],"factory":{"aliases":[["(?-mix:(.+)_id)","\\1"],["(?-mix:(.*))","\\1_id"]],"definition_file_paths":[{"path":"/vagrant/factories"},{"path":"/vagrant/test/factories"},{"path":"/vagrant/spec/factories"}]},"always_reload":true,"kernel":{},"file_system":{},"factory_cleaner":{},"latest_mtime":null,"dir_system":{}}