Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
💻 🤓 💻

Chris Frewin princefishthrower

💭
💻 🤓 💻
View GitHub Profile
@princefishthrower
princefishthrower / ExampleUsage.cs
Created Mar 26, 2021
Dynamic Where Expressions With EF Core
View ExampleUsage.cs
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;
View pipelines-8.yml
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:
View pipelines-7.yml
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:
View pipelines-6.yml
pipelines:
branches:
master:
- step:
name: Install npm modules and build production site via tsc
script:
- npm install
- tsc
artifacts:
- node_modules/**
View pipelines-5.yml
pipelines:
branches:
master:
- step:
name: Install npm modules and build production site via tsc
script:
- npm install
- tsc
artifacts:
- node_modules/**
View pipelines-4.yml
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/**
View pipelines-3.yml
pipelines:
branches:
master:
- step:
name: Install npm modules with npm install and build production site via tsc
script:
- npm install
- npm run build
View pipelines-2.yml
pipelines:
branches:
master:
- step:
name: Our Very First Pipeline!
script:
- echo "Hello World!"
View pipelines-1.yml
pipelines:
branches:
master:
- step:
name: Our Very First Pipeline!
script:
- echo "Hello World!"
@princefishthrower
princefishthrower / pipe.js
Created Oct 14, 2020
pipe.js - execute as many functions as needed in series
View pipe.js
// 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) => a + b;
// const addThree = (a, b, c) => a + b + c;
// const result = pipe(addTwo(1, 2), addThree(3, 4, 5));
// console.log(result);
// 6
const combine = (f, g) => (...args) => g(f(...args));
export const pipe = (...fns) => fns.reduce(combine);