Skip to content

Instantly share code, notes, and snippets.

public string GetAccountNumber()
{
static bool IsRecruit(string purposeCode) => new List<string> { "AR", "SR", "FR" }.Contains(purposeCode);
return (GroupTravel, TravelerType, Destination) switch
{
(true, _, "I") => "6034",
(true, _, "O") => "6035",
(true, _, "F") => "6036",
(false, TravelerType.FacultyStaff, "I") => "6025",
(false, TravelerType.FacultyStaff, "O") => "6026",
@MollsAndHersh
MollsAndHersh / microdata_resume_cv.html
Created March 11, 2022 17:38 — forked from danielantelo/microdata_resume_cv.html
HTML5 Microdata Resume (Curriculum) Template
<!DOCTYPE html>
<html>
<head>
<!-- Meta conf -->
<meta charset="UTF-8">
<!-- Meta info -->
<title>HTML5 Microdata Resume (CV) Template</title>
<meta name="description" content="An example of how to layout a semantic html5 page for a curriculum vitae/resume">
<meta name="keywords" content="template, html, semantic, microdata, resume, cv, curriculum, vitae">
</head>
@MollsAndHersh
MollsAndHersh / index.html
Created February 25, 2022 23:02 — forked from alasomlira/index.html
SwiperJS & YouTube
<div class="wrap">
<div class="wrap-inner">
<div class="swiper-outter">
<div id="video-swiper" class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="video-container">
<div class="yt-player" data-id="MxBRpWcXeOA"></div>
using System;
using DynamicAndGenericControllersSample;
public class Book : IObjectBase
{
public Guid Id { get; set; }
public string Title { get; set; }
public string Author { get; set; }
@MollsAndHersh
MollsAndHersh / fix-image-maps.js
Created October 8, 2021 20:48 — forked from guregu/fix-image-maps.js
Responsive image maps (vanilla JS)
function fixImageMaps(force) {
var imgs = document.querySelectorAll("img[usemap]");
[].forEach.call(imgs, function(img) {
if (!img.naturalHeight) { return; }
var h = img.height / img.naturalHeight;
var w = img.width / img.naturalWidth;
var map = document.getElementsByName(img.useMap.slice(1))[0];
if (!map) { return; }
for (var i = 0; i < map.children.length; i++) {
var area = map.children[i];
@MollsAndHersh
MollsAndHersh / rotate.js
Created May 13, 2021 18:25 — forked from kahays/rotate.js
Rotate the first HTML5 video element on the page (made for interrupting a sleep pattern with Netflix.)
(function(videoDOMElement){
if (!window.rotateVideo) {
var timeout = undefined;
var rotation = "off";
window.rotateVideo = rotateVideo;
}
if (!document.getElementById('bookmarklet-rotated-video'))
{
var dynamicStyle = document.createElement("style");
dynamicStyle.id = "bookmarklet-rotated-video";
@MollsAndHersh
MollsAndHersh / rotate.js
Created May 13, 2021 18:25 — forked from kahays/rotate.js
Rotate the first HTML5 video element on the page (made for interrupting a sleep pattern with Netflix.)
(function(videoDOMElement){
if (!window.rotateVideo) {
var timeout = undefined;
var rotation = "off";
window.rotateVideo = rotateVideo;
}
if (!document.getElementById('bookmarklet-rotated-video'))
{
var dynamicStyle = document.createElement("style");
dynamicStyle.id = "bookmarklet-rotated-video";
@MollsAndHersh
MollsAndHersh / crypto-aes-gcm.js
Created April 20, 2021 23:00 — forked from chrisveness/crypto-aes-gcm.js
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');