Skip to content

Instantly share code, notes, and snippets.

View brand-it's full-sized avatar

Brandt Lareau brand-it

View GitHub Profile
@brand-it
brand-it / create_ssl.sh
Last active June 9, 2022 16:05
This build tinderbox ssl certs for local development. Can be used for other things but. Also designed to add it to Mac credentials
#!/usr/bin/env ruby
require 'fileutils'
require 'tempfile'
# cn = '*.tb.local.vhost'
# server_name = 'dev.tb.local.vhost'
# admin_server_name = 'admin.tb.local.vhost'
@brand-it
brand-it / program.cpp
Created May 17, 2012 18:37
C++ Program
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int m; //Total number of rows
int n; //Total number columns
double w; //The size of each tile in inches
double h; //The size of each tile in inches
@brand-it
brand-it / default_ruby_version.txt
Last active April 5, 2022 00:10
I use this to full my Alfred Workflows
3.1
@brand-it
brand-it / simple_gql_ruby.rb
Last active March 24, 2022 21:36
Simple tool for making GQL request with vanilla ruby
require 'uri'
require 'json'
require 'net/http'
class Gql
class Base
Response = Struct.new(:http) do
def success?
http.is_a?(Net::HTTPSuccess)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brand-it
brand-it / geo.json
Last active November 12, 2021 21:51
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brand-it
brand-it / Dockerfile
Created August 16, 2021 15:36
Rails Template ruby 2.7.3 with nodejs
# Choose a version of Ruby
FROM ruby:2.7.3-slim
ARG APP_NAME=lentille
ARG BUNDLER_ARGS
ARG BUNDLE_WITH
ARG BUNDLE_WITHOUT
ARG BUNDLE_DEPLOYMENT
ENV APP_NAME=${APP_NAME}
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'json'
require 'pry'
def files
@files ||= begin
`git diff --staged --name-only --cached`.split("\n").reject do |file|
!File.exists?(file)
end
@brand-it
brand-it / rspec_hook
Last active April 15, 2021 22:04
A tool to test in a effect way by only testing the min amount. .git/hooks/pre-commit.d/rspec
#!/usr/bin/env ruby
class ExampleStatusParser
def self.parse(string)
new(string).parse
end
def initialize(string)
@header_line, _, *@row_lines = string.lines.to_a
end
@brand-it
brand-it / transfer_gems_from_geminaox.rb
Last active January 12, 2021 19:49
Lazy code to move gems from one gem inabox to another. requires the gem inabox to be installed
#!/usr/bin/env ruby
require 'net/http'
require 'open-uri'
require 'tempfile'
require File.expand_path('ruby_bash', __dir__).to_s
options = {}
parser = OptionParser.new do |opts|
opts.banner = 'Usage: replicate gem inabox'