Skip to content

Instantly share code, notes, and snippets.

View zmaril's full-sized avatar
🌹
Crawling the web

Zack Maril zmaril

🌹
Crawling the web
View GitHub Profile
@zmaril
zmaril / keybase.md
Created October 15, 2017 01:52
keybase.md

Keybase proof

I hereby claim:

  • I am zmaril on github.
  • I am zmaril (https://keybase.io/zmaril) on keybase.
  • I have a public key ASBSk8HWQgCYHukY5NAte5V6YE7IXitE1OkatCXhsz0-hAo

To claim this, I am signing this object:

[{:lines ["/* $OpenBSD: scp.c,v 1.187 2016/09/12 01:22:38 deraadt Exp $ */" 
          "/*" 
          "* scp - secure remote copy.  This is basically patched BSD rcp which" 
          "* uses ssh to do the data transfer (instead of using rcmd)." 
          "*" 
          "* NOTE: This version should NOT be suid root.  (This uses ssh to" 
          "* do the transfer and ssh has the necessary privileges.)" 
          "*" 
          "* 1995 Timo Rinne <[email protected]>, Tatu Ylonen <[email protected]>" 
          "*" 
(ns example.test
(:require [aleph.tcp :as tcp]
[manifold.stream :as stream]))
(defn handler [s info]
(println "START")
(println @(stream/take! s))
(println "STOP"))
(defn start-server
(ns instagenerate.strlenc
(:refer-clojure :exclude [==])
(:require [clojure.core.logic :as l :refer [run* fresh ==]]
[clojure.core.logic.protocols :as lp])
(:import [clojure.core.logic LCons]))
(defn lcount [l]
(loop [i 0 l l]
(println i l)
(if (and (= LCons (type l)) (.d l))
@zmaril
zmaril / simpletest.py
Created February 19, 2014 06:13
Simple bug hunting test
import unittest
from newMethod import GG,Key
class TestnewMethod(unittest.TestCase):
def test_GG(self):
r = GG(Key(8,[[99, 99, 99, 3, 99, 5, 6, 7], [99, 99, 99, 3, 99, 5, 6, 7], [99, 99, 99, 3, 99, 5, 6, 7], [99, 99, 99, 3, 99, 5, 6, 7], [99, 99\
, 99, 3, 99, 5, 6, 7], [99, 99, 99, 3, 99, 5, 6, 7], [99, 1, 99, 3, 99, 99, 6, 7], [99, 1, 99, 3, 99, 99, 6, 7]]))
self.assertEqual(r.solutions,80)
self.assertTrue(r.alternating)
@zmaril
zmaril / index.html
Created November 13, 2013 17:04
TPP highlighted
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-git2.js"></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
@zmaril
zmaril / map_with_indexed.jl
Created October 9, 2013 16:55
map_with_indexed for julia
function map_with_indexed(f,cs...)
args = Any[f,]
push!(args,1:endof(first(cs)))
for c in cs
push!(args,c)
end
apply(map,args)
end
@zmaril
zmaril / index.html
Created October 1, 2013 05:32
Quicksort in 3d (?)
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
@zmaril
zmaril / index.html
Last active December 24, 2015 08:59
Quicksort in 3d
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
@zmaril
zmaril / intro.md
Last active December 23, 2015 22:19
Reverse polish notation macro compiler

I've been messing around with macro compilation and embedded languages in Julia. This is a reverse polish notation compiler built into a macro. Be forewarned, I don't really know julia or how to build a compiler.

I wanted the compiler to leak, so I could pull in environmental variables. a=1; rpn"a 1 +" #Totally valid and should be 2

I wanted the compiler to be able to take in information about the number of arguments to a function. N!f tells the compiler what to do. The default for N is 2. rpn"1 2 3 3!+" # should be 6

Thanks to being a compiler that is porous (unhygenic?), this means that all the power of julia is available to you, the reverse polish notation programmer.