Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Stålberg mast4461

View GitHub Profile
@mast4461
mast4461 / .eslintrc.yml
Last active Nov 17, 2016 — forked from ghostwords/.eslintrc
YAML configuration for ESLint that turns off all* rules. Good starting point. *supposedly at least at the time of last update of the original gist
View .eslintrc.yml
--- # Disable all rules. Rules at http://eslint.org/docs/rules/
ecmaFeatures:
arrowFunctions: false # enable arrow functions
binaryLiterals: false # enable binary literals
blockBindings: false # enable let and const (aka block bindings)
classes: false # enable classes
defaultParams: false # enable default function parameters
destructuring: false # enable destructuring
forOf: false # enable for-of loops
@mast4461
mast4461 / strnpowm.m
Last active Aug 29, 2015
Matlab code for computing large exponentials of the form n^m (n and m integers). Uses chars to store digits, for performance. Handles huge numbers, e.g. 2^1000. Returns the result as a string.
View strnpowm.m
function str = strnpowm(base,exponent)
% Computes base^exponent (both integers) and returns the result as a string
% Handles huge numbers, e.g. 2^1000
str = char(1);
for i = 1:exponent
l = length(str);
product = repmat('0',1,l);
carry = 0;
You can’t perform that action at this time.