Skip to content

Instantly share code, notes, and snippets.

View princefishthrower's full-sized avatar
💭
codevideo.io 🎥

Chris Frewin princefishthrower

💭
codevideo.io 🎥
View GitHub Profile
@princefishthrower
princefishthrower / ExampleUsage.cs
Created March 26, 2021 07:30
Dynamic Where Expressions With EF Core
public List<AppParkingOrderModel> GetHourlyIntersectedBookingsByFacility(string facilityName)
{
var searchCriteria = new List<Expression<Func<AppParkingOrderModel, bool>>>();
var now = DateTime.Now;
var yearFromNow = now.AddYears(1).Year;
var startDateTime = new DateTime(now.Year, 1, 1, 0, 0, 0);
var endDateTime = new DateTime(yearFromNow, 1, 1, 0, 0, 0);
var hours = (endDateTime - startDateTime).TotalHours;
pipelines:
branches:
staging:
- step:
name: Copy Staging Environment (.env.staging.json) to .env.json
script:
- cp /src/env/.env.staging.json /src/env/.env.json
- curl -X POST -H 'Content-type: application/json' --data '{"text":"Staging environment copied into environment!"}' YOUR_WEBHOOK_URL_HERE
master:
- step:
pipelines:
branches:
staging:
- step:
name: Copy Staging Environment (.env.staging.json) to .env.json
script:
- cp /src/env/.env.staging.json /src/env/.env.json
<<<rest of install, build, SCP, SSH scripts and commands>>>
master:
- step:
pipelines:
branches:
master:
- step:
name: Install npm modules and build production site via tsc
script:
- npm install
- tsc
artifacts:
- node_modules/**
pipelines:
branches:
master:
- step:
name: Install npm modules and build production site via tsc
script:
- npm install
- tsc
artifacts:
- node_modules/**
pipelines:
branches:
master:
- step:
name: Install npm modules with npm install and build production site with npm run build
script:
- npm install
- npm run build
artifacts:
- node_modules/**
pipelines:
branches:
master:
- step:
name: Install npm modules with npm install and build production site via tsc
script:
- npm install
- npm run build
pipelines:
branches:
master:
- step:
name: Our Very First Pipeline!
script:
- echo "Hello World!"
pipelines:
branches:
master:
- step:
name: Our Very First Pipeline!
script:
- echo "Hello World!"
@princefishthrower
princefishthrower / pipe.js
Last active June 1, 2021 09:36
pipe.js - execute as many functions as needed in series
// pipe.js - execute as many functions as needed in series
// from https://egghead.io/lessons/react-create-a-pipe-function-to-enable-function-composition
// usage:
// const addTwo = (a, b) => console.log(a + b);
// const addThree = (a, b, c) => console.log(a + b + c);
// pipe(addTwo(1, 2), addThree(3, 4, 5));
// 3
// 12
const combine = (f, g) => (...args) => g(f(...args));
export const pipe = (...fns) => fns.reduce(combine);