Skip to content

Instantly share code, notes, and snippets.

View oxidist's full-sized avatar
💭
thinking...

Oxide oxidist

💭
thinking...
View GitHub Profile
import { ActionTypes } from '../createStore';
import isPlainObject from '../utils/isPlainObject';
import mapValues from '../utils/mapValues';
import pick from '../utils/pick';
/* eslint-disable no-console quotes no-unused-vars */
function getErrorMessage(key, action) {
var actionType = action && action.type;
var actionName = actionType && ('"${actionType.toString()}"') || ('an action');
@oxidist
oxidist / fonts.xml
Created August 7, 2017 19:45
fonts.conf
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<fontconfig>
<dir>~/.fonts</dir>
<match>
<test name="family">
<string>sans-serif</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>Lucida Grande</string>
</edit>
import math
def prod(arr, index):
tot = 1
for i in range(index):
tot *= arr[i]
return tot
def check_inequality(arr, x):
return math.log(prod(arr, x), 2.4) < arr[x+1] # whether prod primes < (2.4)^n, change the 2.4 in the log to check for different bases
@oxidist
oxidist / nanopond.c
Created June 12, 2019 20:18
nanopond
/*
* Nanopond is just what it says: a very very small and simple artificial
* life virtual machine.
*
* It is a "small evolving program" based artificial life system of the same
* general class as Tierra, Avida, and Archis. It is written in very tight
* and efficient C code to make it as fast as possible, and is so small that
* it consists of only one .c file.
*
* How Nanopond works:
un :: Rational -> Rational
un 1 = -2
un x = (2 * (un (pred x) ^^ 2) + 5 * (un (pred x)) - 7)^^(1 % 3)
main :: IO()
main = do
print $ un $ 10
@oxidist
oxidist / 78.hs
Last active July 25, 2019 15:46
Project Euler 78
import Data.Array (Array, array, (!), assocs)
import Data.List (transpose, foldl')
interleave :: [a] -> [a] -> [a]
interleave xs ys = concat . transpose $ [xs, ys]
pent :: [Int] -> [Int]
pent = map (\x -> div (3*x^2 - x) 2)
pentagonals :: [Int]
\usepackage{libertine}
\usepackage{libertinust1math}