This file contains hidden or 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
// The following code is from http://www.academicpub.org/PaperInfo.aspx?PaperID=14496 . | |
import java.math.BigInteger; | |
import java.security.*; | |
import java.security.spec.*; | |
import javax.crypto.KeyAgreement; | |
public class ECCKeyAgreement { | |
public static void main(String[] args) throws Exception { | |
KeyPairGenerator kpg; | |
kpg = KeyPairGenerator.getInstance("EC","SunEC"); |
This file contains hidden or 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 scala.deriving._ | |
import scala.compiletime.{erasedValue, summonInline} | |
// super primitive (but composable via typeclass derivation) JSON reader | |
trait Reader[A] { | |
def read(json: ujson.Value): A | |
} | |
object Reader { | |
given Reader[Int] = new Reader[Int] { |
This file contains hidden or 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 time, sys, random | |
def loading(count): | |
all_progress = [0] * count | |
sys.stdout.write("\n" * count) # Make sure we have space to draw the bars | |
while any(x < 100 for x in all_progress): | |
time.sleep(0.01) | |
# Randomly increment one of our progress values | |
unfinished = [(i, v) for (i, v) in enumerate(all_progress) if v < 100] | |
index, _ = random.choice(unfinished) | |
all_progress[index] += 1 |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | |
<style type="text/css"> | |
.term { | |
background-color: rgba(43,43,43,0.99); | |
color: rgb(169,183,198); | |
padding: 1em; |
This file contains hidden or 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
#!/bin/bash | |
# Manage a collection of github mirrors. | |
# | |
# This script provides functionality to clone and update git | |
# repositories as mirrors. The update functionality is silent on | |
# successful updates and is designed to be called in an automated way, | |
# such as with cron. | |
# | |
# All mirror repositories are assumed to be contained under one base | |
# directory (by default ~/public_git), configurable via a flag. |
This file contains hidden or 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
package spray.json | |
import scala.language.experimental.macros | |
import scala.reflect.macros.blackbox.Context | |
trait MacroFormats { | |
def macroReader[A]: RootJsonReader[A] = macro MacroFormatsBundle.jsonReader[A] | |
def macroWriter[A]: RootJsonWriter[A] = macro MacroFormatsBundle.jsonWriter[A] |
This file contains hidden or 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
object Main extends App { | |
type Succ[A] <: Shape | |
type _0 <: Shape | |
type _1 = Succ[_0] | |
type _2 = Succ[_1] | |
type _3 = Succ[_2] | |
type Shape |
This file contains hidden or 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
#!/usr/bin/env scala | |
import math._ | |
import scala.util.Random | |
val Iterations = 100000 | |
val MaxAttackers = 15 | |
val MaxDefenders = 15 | |
/** Randomly simulates a complete attack (until there are either no attackers or defenders left). |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am jodersky on github. | |
* I am jodersky (https://keybase.io/jodersky) on keybase. | |
* I have a public key whose fingerprint is 4E7D A7B5 A0F8 6992 D6EB 3F51 4601 8786 62E3 3372 | |
To claim this, I am signing this object: |
NewerOlder