Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
iOS, Capacitor, Ember, Vue, Rails

Benjamin Borowski typeoneerror

🤠
iOS, Capacitor, Ember, Vue, Rails
View GitHub Profile
View create.js
await notion.pages.create({
parent: {
database_id: 'abc123',
},
properties: {
Alias: {
rich_text: [
{
type: 'text',
text: {
@typeoneerror
typeoneerror / dougit.sh
Last active Nov 10, 2021
npm pack hack workaround
View dougit.sh
#!/usr/bin/env bash
##
# dougit.sh
#
# Automate the "Doug Method".
#
# SEE: https://www.notion.so/precisionnutrition/fixing-yarn-link-bebfc631847d420c8266bf2f4f917fda
#
# NOTE: This assumes that you are operating in an "app folder", e.g. es-certification,
View essay-01.md

(1) First Day on Duty

Today is for firsts

My first #ship30for30 essay. It's also my first day on "duty" as an alternate lieutenant at the Halfmoon Bay Volunteer Fire Department. I'll spend the week on-call 24/7—ready for response—emergency and non-emergency.

I started the morning helping EMS with a stage 4 cancer patient. Car 1 (my duty designation and truck) is parked in the driveway, prepared to respond when I receive a page.

And, to be perfectly honest, today I feel more prepared to lead an interior attack on a burning structure than to write a 250 word essay. But then, I didn't get to where I am as a volunteer firefighter by avoiding scary unknowns.

@typeoneerror
typeoneerror / yarn-link-list.sh
Last active Feb 25, 2021
Helper for yarn linking PN node modules
View yarn-link-list.sh
View workflow.yml
# This works for PUSH but not PULL_REQUEST
if: "!contains(github.event.head_commit.message, '[skipci]')"
# So down here in the STEP, grab the commit message via git log
# But now how do I EXIT the workflow??
- name: Skip if commit contains skipci
run: |
commitmsg=$(git log --format=%B -n 1 ${{ github.event.after }})
View orderable.rb
module Orderable
extend ActiveSupport::Concern
module ClassMethods
##
# Run a "single" query to update multiple records by a position field.
#
# The Array of passed in IDs are sorted in the order they are provided in the array.
View confirm-transition.js
// mixins/confirm-transition.js
import Ember from 'ember';
const {
isPresent,
Mixin,
RSVP
} = Ember;
@typeoneerror
typeoneerror / notes.md
Last active Jul 18, 2018
Key-Value CSS validation concept
View notes.md

Iheanyi,

I realize your app may not be ruby-based, but here's how I've worked with this dilemma in mind in our app. To start, yes, we don't necessarily support custom CSS, but I do have a database field I (as admin) can add custom CSS to a customer's account template (in the case they have "premium support" or something). Our publicly customizable style settings are key:value based and stored as a JSON object in psql as you suggested might be an option. Here's how I make it less unweildy:

Field in the database:

t.json :settings
View drip-es6.js
// @flow
/**
* {
* success: true,
* visitor_uuid: "f627ee608adb01315d1022000ab2058a",
* anonymous: false,
* email: "john@acme.com",
* custom_fields: { "name": "John" },
* tags: ["Customer"],
View repair_progress_spec.rb
unlock_tests = [
['ULLL', 'ULLL'], # first unlocked, do nothing
['LLLL', 'ULLL'], # first should be unlocked
['LULL', 'UULL'],
['LLUL', 'UUUL'],
['LLLU', 'UUUU'],
['UULL', 'UULL'],