This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use argon2::{Argon2, PasswordHash}; | |
use axum_extra::extract::cookie::{Cookie, SameSite}; | |
use axum_extra::extract::CookieJar; | |
async fn login_user( | |
ctx: State<ApiContext>, | |
Json(data): Json<LoginUser>, | |
) -> Result<(CookieJar, Json<LoginResponse>)> { | |
let user = models::user::get_user_pass_hash(&ctx.db, &data.email) | |
.await? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/fix-php-cs.yml | |
on: | |
pull_request: | |
name: Coding Standards | |
jobs: | |
open-pr-for-cs-violations: | |
name: PHP-CS-Fixer | |
runs-on: ubuntu-20.04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.addEventListener('install', (e) => { | |
e.waitUntil( | |
caches.open("precache").then((cache) => cache.add("/broken.png")) | |
); | |
}); | |
function isImage(fetchRequest) { | |
return fetchRequest.method === "GET" && fetchRequest.destination === "image"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require('lodash'); | |
module.exports = function({ ratios, options, variants }) { | |
return function({ addUtilities, e }) { | |
const opts = Object.assign({}, { | |
orientedRatios: false, | |
invertedRatios: false | |
}, options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppetteer = require("puppeteer"); | |
/** | |
* @param {string} pageUrl The URL that you want to gather coverage data for | |
*/ | |
const unusedCode = async pageUrl => { | |
const browser = await puppetteer.launch(); | |
console.log("browser launched"); | |
const page = await browser.newPage(); | |
console.log("new page created"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpenSimplexNoise noise; | |
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gif by dave — enjoy! :) | |
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { | |
if (p < 0.5) | |
return 0.5 * pow(2*p, g); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by david whyte :) | |
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
/******************************************************************************* | |
OpenSimplex Noise in C++ | |
Ported from https://gist.github.com/digitalshadow/134a3a02b67cecd72181 | |
Originally from https://gist.github.com/KdotJPG/b1270127455a94ac5d19 | |
Optimised by DigitalShadow | |
This version by Mark A. Ropper (Markyparky56) | |
*******************************************************************************/ | |
#include <array> | |
#include <vector> |
NewerOlder