Skip to content

Instantly share code, notes, and snippets.

View CrackerHax's full-sized avatar

CrackerHax

View GitHub Profile
@CrackerHax
CrackerHax / ecrecover.cpp
Last active June 21, 2023 13:59
C++ ethereum ecRecover function using libsecp256k1 (with recovery module enabled) and keccak-tiny. Returns public eth address from signed message. Used to prove ownership of an eth address for logging in, etc.
#include "keccak-tiny.h"
#include "secp256k1.h"
#include "secp256k1_recovery.h"
std::string bytes_to_hex_string(const uint8_t *str, const uint64_t s)
{
std::ostringstream ret;
for (size_t i = 0; i < s; ++i)
ret << std::hex << std::setfill('0') << std::setw(2) << std::nouppercase << (int) str[i];
@CrackerHax
CrackerHax / datasets.py
Last active June 5, 2019 13:35
Replacement datasets.py for google/compare_gan/compare_gan (https://github.com/google/compare_gan) to load custom .tfrecords
# coding=utf-8
# Copyright 2018 Google LLC & Hwalsuk Lee.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@CrackerHax
CrackerHax / create_tfrecord.py
Last active June 3, 2019 13:48
Create tfrecords labeled by category from directories of images
from random import shuffle
import glob
import sys
import cv2
import numpy as np
import tensorflow as tf
name = 'mountains' # name of your project directory where all images are
# should be under ./images/train (or change the path variable below)
image_size = 256 # size of images - should be square images (i.e. 256x256)
@CrackerHax
CrackerHax / hifi_websocket_test.js
Last active November 17, 2015 22:10
A script to test your highfidelity websockets
var wsUri = "ws://echo.websocket.org";
var wssUri = "wss://echo.websocket.org";
var connection;
function load(uri) {
connection = new WebSocket(uri);
connection.onopen = function () {
var send = "Hello, world!";
@CrackerHax
CrackerHax / scriptending_test.js
Last active September 14, 2019 11:19
Another Script.scriptending test script for highfidelity.io
function scriptStopped()
{
print("script stopped");
}
Script.scriptEnding.connect(scriptStopped);
@CrackerHax
CrackerHax / gist:18855905c998a2f0dca3
Last active September 14, 2019 11:20
Forced Overlay Test Script for highfidelity.io
(function()
{
// define colors
var black = { red: 0, green:0, blue:0};
var white = { red: 255, green:255, blue:255};
var window = [];
function newWindow(posx,posy)
{
@CrackerHax
CrackerHax / JsonRPC.js
Last active September 14, 2019 11:21
Sample JsonRPC code for highfidelity.io
function post(method,params)
{
var r_txt ='{"jsonrpc":"2.0","method":"'+method+'","params":{'+params+'},"id":1234}';
var http = new XMLHttpRequest();
http.open("POST", 'http://foo.com:8082', true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", r_txt.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {
if (http.readyState == 4) {
@CrackerHax
CrackerHax / rightclick.js
Last active September 14, 2019 11:21
Simple right click menu script for highfidelity.io
// Simple Right Click Menu by Cracker Hax
// declare some arrays
var btn=[];
var txt=[];
// define our menu items
var cmd = ["Menu Item 1","Menu Item 2","Menu Item 3"];
// define button size