Skip to content

Instantly share code, notes, and snippets.

View ericmann's full-sized avatar
⚒️
Creating ...

Eric Mann ericmann

⚒️
Creating ...
View GitHub Profile
@ericmann
ericmann / umap_sparse.py
Created August 23, 2018 18:32 — forked from johnhw/umap_sparse.py
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@ericmann
ericmann / cryptopals_set_8.md
Created July 17, 2018 22:29 — forked from arkadiyt/cryptopals_set_8.md
Cryptopals Set 8

Cryptopals is a set of cryptographic challenges, originally published here: https://cryptopals.com

Set 8 of the challenges was never published publicly, until late March 2018. However the cryptopals website was not updated to include the challenges. This gist compiles the 8th set of the Cryptopals challenges.

title link
57. Diffie-Hellman Revisited: Small Subgroup Confinement https://toadstyle.org/cryptopals/513b590b41d19eff3a0aa028023349fd.txt
58. Pollard's Method for Catching Kangaroos https://toadstyle.org/cryptopals/3e17c7b35fcf491d08c989081ed18c9a.txt
59. Elliptic Curve Diffie-Hellman and Invalid-Curve Attacks https://toadstyle.org/cryptopals/a0833e607878a80fdc0808f889c721b1.txt
@ericmann
ericmann / yubikey-reset.sh
Created July 6, 2018 03:37 — forked from pkirkovsky/yubikey-reset.sh
Utility for resetting a Yubikey to factory defaults using gpg-connect-agent. This will wipe out any stored keys and reset PINs to default values.
gpg-connect-agent <<EOF
/hex
scd serialno
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
@ericmann
ericmann / pr.md
Created June 22, 2017 21:05 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

<?php
/*
author: jeedo aquino
file: wp-index-redis.php
credit: jim westergren
updated: 2012-10-23
this is a redis caching system for wordpress inspired by jim westergren.
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
@ericmann
ericmann / default.conf
Created May 11, 2013 23:46
Default WordPress Nginx configuration file.
server {
listen 80;
server_name XX.XX.XX.XX;
root /var/www/html/default;
location / {
index index.php;
try_files $uri $uri/ /index.php?$args;
}
@ericmann
ericmann / gist:7745729
Created December 2, 2013 06:00
PHPUnit Protected accessibility example
<?php
/**
* This class contains one protected method we wish to test.
* In reality, it would also contain several public methods,
* but that's immaterial to our discussion.
*
* @pacakge Tutorials
*/
class ClassToTest {
/**
@ericmann
ericmann / gist:7702180
Last active December 29, 2015 17:09
Quicky PHPUnit accessiblity example.
<?php
/**
* This class contains two private methods we wish to test.
* In reality, it would also contain several public methods,
* but that's immaterial to our discussion.
*
* @package Tutorials
*/
class ClassToTest {
/**
@ericmann
ericmann / gist:5949377
Last active December 19, 2015 11:39
Pseudo-singleton for WordPress.
<?php
class Example {
public function __construct() {
$this->instantiate();
}
public function instantiate() {
static $instance = null;
@ericmann
ericmann / class-wp-cookie-ixr-client.php
Created June 18, 2013 20:05
Build an IXR_Client object that uses WordPress' built-in HTTP request layer as a transport, while still passing user cookies along with the request.