Skip to content

Instantly share code, notes, and snippets.

View brainded's full-sized avatar

Adam Valverde brainded

View GitHub Profile
@brainded
brainded / bio6mockexam.jsx
Created May 12, 2026 02:03
bio6 mock exam
import { useState, useEffect } from "react";
const questions = [
// Cell Structure & Function
{ id: 1, section: "Cell Structure & Function", question: "Which of the following is NOT one of the 6 characteristics of living things?", options: ["Can reproduce", "Can photosynthesize", "Can maintain homeostasis", "Has one or more cells"], answer: 1 },
{ id: 2, section: "Cell Structure & Function", question: "Which of the following correctly states the Cell Theory?", options: ["Cells are the largest unit of life", "All living things are composed of cells, all cells come from existing cells, and cells are the smallest unit of life", "Only plants and animals are made of cells", "Cells can spontaneously generate under the right conditions"], answer: 1 },
{ id: 3, section: "Cell Structure & Function", question: "What do ALL cells have in common?", options: ["Cell wall, chloroplast, nucleus", "DNA, ribosomes, and a nucleoid or nucleus", "Mitochondria, Golgi apparatus, ER", "Cytoskeleton, centrioles, lysosomes"]
@brainded
brainded / WebhhookSigning.cs
Last active March 31, 2021 18:40
Virtuous Webhook Signature Verification
using System;
using System.Text;
using System.Security.Cryptography;
public static class WebhookUtility
{
public static bool IsVerified(string payload, string sharedSecret, string virtuousSignature)
{
byte[] valueByteArray = Encoding.UTF8.GetBytes(payload);
byte[] secretByteArray = Encoding.UTF8.GetBytes(sharedSecret);
@brainded
brainded / Program.cs
Created January 16, 2018 23:03
Mode White-Label Embed Token Security
using System;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Text;
using System.Security.Cryptography;
public class Program
{
public static void Main()
{
@brainded
brainded / hmac.php
Created July 20, 2017 21:26
Virtuous Hmac in PHP
<?php
function getHmacToken($applicationKey, $requestHttpMethod, $requestUrl)
{
$privateKey = "VIRTUOUS_API_KEY";
$nonce = uniqid();
$timestamp = (string)time();
$toBeHashed = strtolower($applicationKey . urlencode($requestUrl) . $requestHttpMethod . $nonce . $timestamp);
$hmac = getHashedUrl($toBeHashed, $privateKey);
$authorization = "Hmac " . $applicationKey . ":" . $hmac . ":" . $nonce . ":" . $timestamp;

Keybase proof

I hereby claim:

  • I am brainded on github.
  • I am brainded (https://keybase.io/brainded) on keybase.
  • I have a public key ASAiGbLhWvuZ1MCQwtqngpHc1GMEwf34ogsl4NrfcKpGGQo

To claim this, I am signing this object:

@brainded
brainded / AsyncExtensions.cs
Created June 19, 2015 23:42
Handy Extension class that allows Async execution synchronously.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace BobsBurgers
{
internal static class AsyncExtensions
@brainded
brainded / BobsBurgersController.cs
Last active August 29, 2015 14:06
Utilize Output Cache with User Identity. Found on StackOverflow: http://stackoverflow.com/questions/17187736/output-cache-per-user
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TwitterPoc.Services;
namespace BobsBurgers.Controllers
{
@brainded
brainded / Kudu.json
Last active August 29, 2015 14:05
Kudu Deployment Json
{
"id": "32434k234jlk234l2k3j4j234l",
"status": "success",
"authorEmail": "author@bobsburgers.com",
"author": "author",
"deployer": "GitHub",
"message": "something something darkside",
"progress": "",
"startTime": "2014-08-15T23:17:00.7435764Z",
"endTime": "2014-08-15T23:17:29.0472028Z",
@brainded
brainded / BobsBurgersConfiguration.cs
Created July 21, 2014 06:05
Example of a Custom Configuration Section. Can be used in conjunction with Config Transforms to provide different custom configuration per build/environment.
using System;
using System.Configuration;
namespace Example.Configuration
{
internal class BobsBurgersConfiguration : ConfigurationSection
{
/// <summary>
/// The BobsBurgers ConfigurationSection name.
/// </summary>
@brainded
brainded / JSController.js
Created June 20, 2014 23:53
ValidateAntiForgeryTokenAttribute for WebApi and how to use it.
var authorizationToken = $("#antiforgerytoken").val();
$.ajax({
type:"POST",
beforeSend: function (request) {
request.setRequestHeader("RequestVerificationToken", authorizationToken);
},
url: "entities",
data: {
Something: "something"