Skip to content

Instantly share code, notes, and snippets.

View andrelashley's full-sized avatar

André Lashley andrelashley

  • BC Provincial Government
  • Victoria, British Columbia
View GitHub Profile
@andrelashley
andrelashley / Startup.cs
Created December 13, 2023 03:32 — forked from edijer/Startup.cs
Setting up API authentication using Firebase JWT tokens in ASP.NET Core 3.1.
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.IdentityModel.Tokens;
namespace Reference.WebApi
{
import http from 'k6/http';
import { check, sleep } from 'k6';
export let options = {
stages: [
{ duration: '30s', target: 500 },
{ duration: '15s', target: 500 },
{ duration: '30s', target: 0 },
],
};
@andrelashley
andrelashley / ApplicationUsersController.cs
Created February 15, 2019 23:02
An example of setting roles in ASP.NET MVC
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using System.Web.Mvc;
using MasterDetail.DataLayer;
@andrelashley
andrelashley / after.ts
Created April 27, 2017 16:27
Angular2 routing breaks when navigating in a method call within the subscribe callback of an observable
private submitLoginForm() {
const data = this.formGroup.value;
this.lastSubmission = JSON.stringify(data);
const toast = this.toaster.toast({
title: "Logging in..."
});
this.tellwell.doLogin(data)
.subscribe(result => {
this.toaster.clear(-1, toast);
@andrelashley
andrelashley / cursor-example.sql
Created March 7, 2017 03:42
An example using cursors in oracle
DECLARE
-- step1: declare the variables
v_product_id product.product_id%type;
v_product_name product.product_name%type;
v_product_list_price product.list_price%type;
-- step 2: declare the cursor
CURSOR v_product_cursor IS
SELECT product_id, product_name, list_price
FROM product
[
{
"name": "Elephants",
"latitude": 39.749157,
"longitude": -104.953616
},
{
"name": "Tigers",
"latitude": 39.749817,
"longitude": -104.949195
[
{
"name": "Reticulated Giraffe",
"species": "Giraffa camelopardalis reticulata",
"description": "The reticulated giraffe (Giraffa camelopardalis reticulata), also known as the Somali giraffe, is a subspecies of giraffe native to Somalia, southern Ethiopia, and northern Kenya. Reticulated giraffes can interbreed with other giraffe subspecies in captivity or if they come into contact with populations of other subspecies in the wild. \nThe reticulated giraffe is among the most well-known of the nine giraffe subspecies. Together with the Rothschild giraffe, it is by far the giraffe most commonly seen in zoos. Its coat consists of large, polygonal, liver-colored spots outlined by a network of bright-white lines. The blocks may sometimes appear deep red and may also cover the legs. The extraordinary height of giraffes is attributed to a ritual known as \"necking\", where two males fight for reproduction rights by slamming their necks into one another. The giraffes with the tallest and
{
"name": "foundation-sites-template",
"version": "1.0.0",
"description": "Basic template for a new Foundation for Sites project.",
"main": "gulpfile.js",
"scripts": {
"start": "gulp",
"build": "gulp sass"
},
"repository": {