This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Change top window control colors and code font (to match GitHub) */ | |
:root { | |
--window-button-min: #fac537; | |
--window-button-max: #3aea49; | |
--window-button-close: #f34f56; | |
--code-font: Literation Mono, Liberation Mono, Consolas, Andale Mono WT, Andale Mono, Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono, Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Monaco, Courier New, Courier, monospace; | |
} | |
/* Remove the MaterialDiscord/Discord wordmark */ | |
.wordmark__5b8c9.wordmarkWindows_ffbc5e { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var calc = function (amount) { | |
var a = 1 //change the two variables to get a different fibbonacci sequence | |
var b = 1 | |
for(var i = 0; i < amount; i++) { | |
var i = a+b | |
b = a | |
a = i | |
} | |
console.log(a) //outputs the 'amount' number in the fibbonacci sequence. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var flip = function (dataArray) { | |
var a = dataArray; | |
for(var i = 0; i < a.length; i++) { | |
var b = Math.random(0,1); | |
var c = Math.round(b); | |
if(c === 0) { | |
a[i] = true; | |
} | |
if(c === 1) { | |
var b1 = Math.random(0,1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def f(x, d, g): | |
Y = 0 | |
if x < 0: delta = -d | |
else: delta = d | |
for t in np.arange(0, x, delta): Y+=delta*g(Y) | |
del t | |
return Y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pass in 2 colors {r1,g1,b1} and {r2,g2,b2} | |
Select bi the blend intensity of the first color (0-->1) | |
Output is in form {r,g,b} | |
*/ | |
var blend2A = function (r1,g1,b1,r2,g2,b2,bi) { | |
var endR = bi*r1+r2*(1-bi) | |
var endG = bi*g1+g2*(1-bi) | |
var endB = bi*b1+b2*(1-bi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def binarySearch(array,target): | |
min = 0 | |
max = len(array)-1 | |
guess = 0 | |
while max>=min: | |
guess = floor((min+max)/2) | |
if array[guess] == target: return guess | |
else if array[guess] < target: min = guess+1 | |
else: max = guess-1 |