Skip to content

Instantly share code, notes, and snippets.

View ProdigySim's full-sized avatar

Michael Busby ProdigySim

View GitHub Profile
## /robex/ - 2021 ##
import matplotlib.pyplot as plt
import math
class Weapon:
def __init__(self, rangemod, basedmg, maxrange, gainrange, name):
self.rangemod = rangemod
self.basedmg = basedmg
self.maxrange = maxrange
@fu5ha
fu5ha / parse.rs
Last active August 24, 2020 06:43
#[derive(Debug)]
enum PersonParseError {
Malformed,
AgeParseError(std::string::ParseError),
}
impl fmt::Display for PersonParseError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
PersonParseError::Malformed => write!(f, "Malformed or empty input string"),
let _ = global._ = require("lodash");
let Benchmark = global.Benchmark = require("benchmark");
let Promise = require("bluebird");
let { Map } = require("immutable");
let { produce } = require("immer");
function getItems(count) {
let id = 1;
@georgecrawford
georgecrawford / postcss-remove-important.js
Last active December 8, 2017 21:22
description: "PostCSS plugin to remove any `!important` declarations from all rules"
import * as postcss from 'postcss';
module.exports = postcss.plugin('postcss-remove-important', (options = {}) => {
return css => {
css.walkDecls(decl => {
decl.important = false;
});
};
});
@donnut
donnut / currying.md
Last active October 28, 2023 17:58
TypeScript and currying

TypeScript and currying

In functional programming you often want to apply a function partly. A simple example is a function add. It would be nice if we could use add like:

var res2 = add(1, 3); // => 4

var add10To = add(10);
var res = add10To(5); // => 15
@zachleat
zachleat / gist:2008932
Created March 9, 2012 21:56
Prevent zoom on focus
// * iOS zooms on form element focus. This script prevents that behavior.
// * <meta name="viewport" content="width=device-width,initial-scale=1">
// If you dynamically add a maximum-scale where no default exists,
// the value persists on the page even after removed from viewport.content.
// So if no maximum-scale is set, adds maximum-scale=10 on blur.
// If maximum-scale is set, reuses that original value.
// * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0">
// second maximum-scale declaration will take precedence.
// * Will respect original maximum-scale, if set.
// * Works with int or float scale values.