Skip to content

Instantly share code, notes, and snippets.

View cryptid11's full-sized avatar
™️
this planet is a super awesome joke

cryptid11

™️
this planet is a super awesome joke
View GitHub Profile
@mitjat
mitjat / udacityplots.py
Created September 3, 2012 19:16
A drop-in replacement for the udacityplots library
import base64
import json
import matplotlib, matplotlib.pyplot
import numpy
import types
def show_plot(width, height=None):
"""
A decorator -- show the matplotlib plot after `f` completes.
Takes optional parameters (width, height) determining the size of the plot.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johnny5550822
johnny5550822 / char-rnn nba-archive.md
Last active November 9, 2015 23:45
An automatic generated nba archive by char-rnn

Can you imagine a computer can generate an nba article?

The following is some nba articles fully-automatically generated by char-cnn, a recurrent-neural-network library thanks to Andrej Karpathy [link]. The library is awesome to easy, and very user-friendly. You should try it! :)

Basically, I wrote a python script [link] to extract past archives . And use that as the training set for the recurrent neural network.

The articles below are generated by a network trained with rougly about 2 millions character (which is an okay size; not big enough though). You can see that the generated article contains artificial author names, speeches, etc; similar to an nba archive (although the logic has to be improved, it is FUN.)

You can tune the parameter and train with a even bigger dataset using my script. And you will probably get better result! Have fun:)

@maraoz
maraoz / Original version
Last active October 5, 2016 13:25
Hashed Timelock Contract (HTLC) as proposed in lightning.network paper
OP_DEPTH 3 OP_EQUAL
OP_IF
OP_HASH160 <hash160(R)> OP_EQUALVERIFY
OP_0 2 <AlicePubkey1> <BobPubkey1> 2 OP_CHECKMULTISIG
OP_ELSE
OP_0 2 <AlicePubkey2> <BobPubkey2> 2 OP_CHECKMULTISIG
OP_END
#!/usr/bin/env python3
# toy RSA key generation/encryption/decryption
# this is only a demonstration of the underlying math - extremely unsafe!
# unmodified textbook RSA is both malleable and semantically insecure.
import subprocess
from gmpy import invert # requires gmpy for modular inversion
def ascii2int(string): # function for converting an ascii string to a single integer so that we can do math on it
@echohack
echohack / mp4togif.sh
Created July 29, 2015 17:45
convert an mp4 to gif with ffmpeg
ffmpeg -i input_file.mp4 -vf scale=320:-1:flags=lanczos,fps=30 frames/ffout%03d.png
convert -loop 0 frames/ffout*.png output_file.gif
@pawlos
pawlos / post_install.sh
Last active January 3, 2019 01:11 — forked from waleedahmad/post_install.sh
Ubuntu post installation script for installing software of your choice.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
user=$(who | awk '{print $1}')
#Update and Upgrade
echo "Updating and Upgrading"
"""
Simple test harness for AFL's Unicorn Mode.
This loads the simple_target.bin binary (precompiled as MIPS code) into
Unicorn's memory map for emulation, places the specified input into
simple_target's buffer (hardcoded to be at 0x300000), and executes 'main()'.
If any crashes occur during emulation, this script throws a matching signal
to tell AFL that a crash occurred.
Run under AFL as follows:
@tompng
tompng / template.txt
Last active July 27, 2019 13:17
自己紹介用コード(moved to https://github.com/tompng/tompng)
########################################################################################################################################################################################
########################################################################################################################################################################################
########################################################################################################################################################################################
########### ########################################################################################################################################################################
########### ########################################################################################################################################################################
########### ###################################################################################
#!/usr/bin/env python3
# $ ./nakamotos-wild-mouse.py
# Match between the reverse engineered vaccine and the Biontech Pfizer vaccine when using codon optimization for species:
# * Homo sapiens: 91.07%
# * Mus musculus molossinus (Japanese wild mouse): 91.42% (laboratory mice are usually of the species mus musculus)
#
# The Times 01/Jan/2021 Nakamoto's wild mouse on brink of saving humanity
import dnachisel