Skip to content

Instantly share code, notes, and snippets.

Avatar
💩
status' OR 1=1; --

Kevin Orr KevOrr

💩
status' OR 1=1; --
  • Florida
View GitHub Profile
@KevOrr
KevOrr / ordinal-incrementy-eta.user.js
Last active Jul 14, 2020
Ordinal Markup - Incrementy upgrade ETA
View ordinal-incrementy-eta.user.js
// ==UserScript==
// @name Ordinal Markup - Incrementy upgrade ETA
// @namespace https://kevorr.com
// @version 0.5
// @description Shows estimated time until incrementy upgrades on hover
// @author Kevin Orr
// @match https://patcailmemer.github.io/Ordinal-Markup/
// @grant none
// @downloadURL https://gist.githubusercontent.com/KevOrr/43b10b3bd731b57a8879ac78e4457f96/raw/ordinal-incrementy-eta.user.js
// @updateURL https://gist.githubusercontent.com/KevOrr/43b10b3bd731b57a8879ac78e4457f96/raw/ordinal-incrementy-eta.user.js
@KevOrr
KevOrr / strip.lua
Last active Oct 22, 2019
ComputerCraft strip miner script
View strip.lua
local args = {...}
-- minimum fuel level before returning to refuel
local MINIMUM_FUEL = 2048
if not #args == 0 then
print("Usage: strip")
return
end
@KevOrr
KevOrr / README.md
Created Aug 31, 2019
CPpython re performance
View README.md

Performace of various CPython regexpressions in searching for a substring close to the end of a string

What makes sense to me:

  • patX_1: They are all constant-time since the greedy .* will effectively make the search start at the end
  • patX_2: The non-greedy .*? causes search to start at the beginning of the strings, making this a linear-time operation
  • patX_3: With only a plain pattern, re.search is essentially a non-greedy search, making this also a linear-time operation
@KevOrr
KevOrr / output.txt
Created Jun 4, 2018
Floating Point Weirdness
View output.txt
f1: 0.707106769084930419921875 f3 04 35 3f
f2: 0.707106769084930419921875 f3 04 35 3f
f3: 0.707106769084930419921875 f3 04 35 3f
d1: 0.707106781186547572737311 cd 3b 7f 66 9e a0 e6 3f
d2: 0.707106781186547461715008 cc 3b 7f 66 9e a0 e6 3f
l1: 0.707106781186547572737311 00 68 de f9 33 f3 04 b5 fe 3f 00 00 00 00 00 00
l2: 0.707106781186547524436104 85 64 de f9 33 f3 04 b5 fe 3f 40 00 00 00 00 00
@KevOrr
KevOrr / baseDown.hs
Created May 15, 2018
Take n largest items Haskell
View baseDown.hs
module CodeWars.Largest (largest) where
import Data.List (sortBy, sort)
import Data.Ord (comparing, Down)
largest :: Ord a => Int -> [a] -> [a]
largest n xs = sort $ take n $ sortBy (comparing Down) xs
-- Line 6 causes compilation error:
-- • Data constructor not in scope: Down :: a -> a0
-- • Perhaps you want to add ‘Down’ to the import list
@KevOrr
KevOrr / SKI.sml
Created Apr 17, 2018
Untyped Lambda Calculus to SKI Combinator Calculus
View SKI.sml
datatype lambdaExpr =
Var of string
| Abs of string * lambdaExpr
| App of lambdaExpr * lambdaExpr;
datatype skiExpr =
S
| K
| I
| SKIApp of skiExpr * skiExpr;
@KevOrr
KevOrr / bintree.hs
Last active Jan 29, 2018
64-deep binary tree
View bintree.hs
data Tree a = Leaf a | Node (Tree a) (Tree a)
data Direction = L | R
make :: Integer -> Tree Int
make 1 = Leaf 0
make n = Node (make (n - 1)) (make (n - 1))
get :: Tree a -> [Direction] -> a
get (Node x _) (L:idxs) = get x idxs
get (Node _ y) (R:idxs) = get y idxs
@KevOrr
KevOrr / Language popularity
Last active Aug 8, 2017
Github Repos reports
View Language popularity
Number of repositories where language is in the top 10 languages used
by that repository by bytes written
Repository count: 178220
id | name | top 10 appearances | top 10 appearances (%)
-----+--------------------------+--------------------+------------------------
1 | JavaScript | 65907 | 36.981%
3 | HTML | 44424 | 24.926%
5 | Shell | 39855 | 22.363%
@KevOrr
KevOrr / 7mNz
Created Aug 7, 2017
dpastes for Github GraphQL API support forum
View 7mNz
query($owner:String!, $name:String!) {
repository(owner: $owner, name: $name) {
stargazers(first: 2, orderBy: {field: STARRED_AT, direction: DESC}) {
nodes {
...userExpand
}
}
}
}
fragment userExpand on User {
View pairwise_search.py
#!/usr/bin/env python3
import re
import operator as op
import itertools as it
import sys
def get_positions(text, patterns_a, patterns_b):
position_lists = [tuple((m.start(),m.end()) for p in ps
for m in re.finditer(p, text, re.IGNORECASE) if m)
You can’t perform that action at this time.