Skip to content

Instantly share code, notes, and snippets.

View smitch88's full-sized avatar

Scott Mitchell smitch88

  • Md
View GitHub Profile
@smitch88
smitch88 / table.cljs
Last active February 26, 2017 18:43
Generic Table Component
;; Removing the table component relying on a data fn
(def ext-data
[{:a "1" :b "2" :c "3" :d "4"}
{:a "5" :b "6" :c "7" :d "8"}
{:a "9" :b "10" :c "11" :d "12"}])
(def table-options
{:id "some-table-id"
:fixed-headers true
import { Component, Input, OnInit, EventEmitter, Output } from '@angular/core';
import { FORM_DIRECTIVES } from '@angular/common';
import { Store } from '@ngrx/store';
import { FormControl,
FormBuilder,
FormGroup,
REACTIVE_FORM_DIRECTIVES,
Validators } from '@angular/forms';
import { Observable } from 'rxjs/Observable';
import { Person } from '../../models/';
(ns example.dialog
(:require [reagent.core :as r]
[reagent.dom :as rdom]
[clojure.string :refer [blank? join]]
[goog.dom :as gdom]))
(defn add-container-el
[mount-to id {:keys [mount-to]}]
(when-not (gdom/getElement id)
(let [container-el (.createElement js/document "div")]
getRelatedVideos(hashtagToFind, videos){
return videos.filter(({ title }) => title.indexOf(hashtag) > -1);
}
componentWillReceiveProps(newProps){
const { hashtag } = this.state.projects;
if(this.props.videos.length !=== newProps.videos.length){
this.setState({ videos: this.getRelatedVideos(hashtag, newProps)})
}
@smitch88
smitch88 / keybase.md
Created March 9, 2023 23:46
Verifying self

Keybase proof

I hereby claim:

  • I am smitch88 on github.
  • I am sbmitchell (https://keybase.io/sbmitchell) on keybase.
  • I have a public key ASDUm-7MWxY8ot0ZH7ft3i2gAi8-z0Emguel4pryOBd5Awo

To claim this, I am signing this object:

@smitch88
smitch88 / battleHelpers.js
Last active September 18, 2023 21:12
Bearz battle algo v1.0
export const COEFFICIENT = 50;
export const randomUint256 = () =>
ethers.BigNumber.from(ethers.utils.randomBytes(32));
export const calculateDamage = (stats, oppEndurance, chance) => {
return (
(stats.str / oppEndurance + 2 + (stats.int * 0.5) / 40) *
chance *
(stats.lck * 0.8) +
import { task } from "hardhat/config";
import fs from "fs";
import { range, reduce } from "lodash";
const sumWeights = () => {
const reducer = (p, c, i) => {
if (c[0] <= 0)
throw {
name: "WeightError",
message: `Invalid weight ${c[0]} at index ${i}. Weight cannot be negative or zero.`,
<!--
A short 3D action game for the 2021 js13kGames Competition.
Our hero, Captain Callisto, blasts through space, seeking adventure. What will he find?
Controls:
* Arrow keys or WASD to move
* Z or spacebar to jump
@smitch88
smitch88 / 1.html
Last active May 20, 2024 15:42
BTC Recursive Inscription - Canvas Assembler
<!-- Inscription html file. "src" is an already inscribed `assembler.js` at https://ordinals.com/content/10215b3d07fd53c5a97fe701d7681e9b9049d9b369b85c19a206cee3747bdf19i0. data-height & data-width are the trait layer sizes. data-ids are trait inscription ids. -->
<script id="config"
src="/content/10215b3d07fd53c5a97fe701d7681e9b9049d9b369b85c19a206cee3747bdf19i0"
data-token-id="69420"
data-height="1460"
data-width="1000"
data-ids="756ef03122e4bc39cd867b2d8d06845bbd9ebae6a48e23e951593c0cf2f7a1bbi0,55c0aa11543bcd2c07932bf825f9cf4d46eeb4eae0633983b33919d33f10dda2i4,cd2cabfc0779d3ffd6fc91c0b3296dddf2ba24d1a720e844d9e094d44c11f5f1i3,ba29de2e0a5bcad7248d4ff0452fa868df237b1bdf79fb4f810427edbb7b8bf1i2,5a3c7e26305548a4c616b61d899ecc139ce64f68bfe41b085d94a97ca37d8df3i2,1785a69e69eb0a44c98a04293a066eaebdb9b884089d73d6efb01c7d1e101feci7,0200a772d01023e124d7bbd4c92585361e52443f25f22cd28ede0715efce2c2ci8,e549a342b57781b649cc99c9b77a65f319833b73106705829ea6378b9e088f48i3">
</scrip