Skip to content

Instantly share code, notes, and snippets.

View captaincole's full-sized avatar

Andrew Cole captaincole

View GitHub Profile
@captaincole
captaincole / sample_response.json
Created October 21, 2022 18:17
Sample Old Response
{movements_description: "", masters_content: "<div id="block_6212d75f05676" class="wodsteps ">
<div class="wodsteps-viewslider owl-carousel owl-theme-black">
<div class="wodstep">
<h3 class="wodstep__title"">1. Morning Movement &#8211; For Completion</h3> <div class=" wodstep__content">
<p>5:00 Run @ Forever Pace*<br /> Every Minute, starting at 1:00, Perform 12 Jump Squats<br />
Then<br /> 1:00 Noes and Toes Hold<br /> into<br /> Sun Salutations – Follow along with Austin and
Caroline <strong><a href="https://www.youtube.com/watch?v=ruDd82g5Gyk">HERE!</a></strong><br /> The
goal with Morning Movement is to warm your body up, take your time when moving through this and
focus more on quality and control rather than speed. Move with intention.</p>
</div>
@captaincole
captaincole / JooqCodegen.scala
Last active December 20, 2019 20:11
jOOQ Codegen Enum Object
// jOOQ Generated OrderAssetType Enum
sealed trait OrderAssetType extends EnumEntry
object OrderAssetType extends Enum[OrderAssetType] {
val values = findValues
case object common_stock extends OrderAssetType
case object preferred_stock extends OrderAssetType
}
@captaincole
captaincole / CreateAssetTypesEnum.sql
Last active December 20, 2019 20:11
Asset Type Enum SQL Migration
CREATE TYPE order_asset_type AS ENUM (
'common_stock',
'preferred_stock',
);
@captaincole
captaincole / SangriaScala.scala
Created October 23, 2019 00:08
Sangria Scala Query For Order by Asset Type
// Example of a type safe query that returns an Order object
def orderByAssetType(assetType: OrderAssetType)(implicit ctx: C): Future[OrderRead] = db.run { dsl =>
dsl.selectFrom(ORDER)
.where(ORDER.ASSET_TYPE equal assetType)
.fetchOne()
.make[OrderRead] // Return an Order Object
}
@captaincole
captaincole / GqlCodeGen.tsx
Last active December 20, 2019 20:12
Graphq
// GraphQL Query
ordersByAsset(assetType: $assetType) {
id
asset_type
}
// GraphQL Codegen
export enum OrderAssetType {
CommonStock = 'common_stock',
PreferredStock = 'preferred_stock',
// src/global/variables.scss
:root {
--ion-color-primary: $app-primary-color;
}
$color: (
primary: #009688,
secondary: #3F51B5
);
// In some other scss file, reference this variable
.active {
color: map-get($color, primary);
}
$app-primary-color: #009688;
const sass = require('@stencil/sass');
exports.config = {
serviceWorker: {
swSrc: 'src/sw.js'
},
globalStyle: 'src/global/app.css',
plugins: [
sass({injectGlobalPaths: [
'src/global/variables.scss'
@captaincole
captaincole / variables.angular.scss
Created March 4, 2018 22:18
Ionic Angular Scss variables
$colors: (
primary: #06D3CA,
secondary: #314655,
danger: #f53d3d,
border: #EFEFEF,
dark: #222,
header: rgba(38,38,38,1),
error: #E0343D,
description: #5f5757,
"image-overlay" : rgba(0,0,0, 0.2),