Skip to content

Instantly share code, notes, and snippets.

View octalmage's full-sized avatar

Jason Stallings octalmage

View GitHub Profile
@larry0x
larry0x / json-raw-message-to-sdk-msg.go
Created June 16, 2023 03:37
json.RawMessage to sdk.Msg
package main
import (
"encoding/json"
"fmt"
"reflect"
"cosmossdk.io/simapp"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
@webmaster128
webmaster128 / WASMVM_PATCH_ANNOUNCEMENT.md
Last active November 10, 2021 00:41
CosmWasm patch to be released on Wednesday, November 10th

A bug in wasmvm has been discovered.

Bug

This bug

  1. can potentially crash the node,
  2. can potentially cause consensus failures.

No code path is known to the author that can cause 1 or 2, but this does not guarantee such paths do not exist.

@lispc
lispc / multi_sig.sh
Last active January 16, 2020 08:08
IOST multiple signature
set -eu
TEST_USER_ID="testname"
GROUP="group"
IWALLET_CMD='iwallet --chain_id 1020 -s 127.0.0.1:30002' # single node dev chain
seckey1=3MWryACc5nSxRDJCJLe9Xq2spR1j7d5wYbZ4pZN4SvfgUxhG497DQxo5ahENoCnDkLsc7haSveP1q1zkt26JWhog
pubkey1=2ott3o9CZcaoZCe4nGYo1azEfEpY4W771GBFe133WW1p
function clean_account() {
$IWALLET_CMD account del $TEST_USER_ID
@darraghoriordan
darraghoriordan / swhmac.groovy
Created September 19, 2017 06:56
Adding custom hmac auth to swagger ui
(function () {
$(function () {
/*I add the ui elements I need here. I thought it would be better put them in here at runtime rather than hard code them in the index.html in case the index.html from my version of swashbuckle is made obsolete in a future version of the package. */
var hmacAuthUi =
'
<div class="input"><label for="input_api_username">Api Username: </label><input placeholder="Api Username" id="input_api_username" name="input_api_username" type="text" size="20"></div>
' +
'
<div class="input"><label for="input_api_hmackey">Api Key: </label><input placeholder="ApiKey" id="input_api_hmackey" name="input_api_hmackey" type="text" size="20"></div>
@ericclemmons
ericclemmons / example.md
Last active September 20, 2024 12:46
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@motionharvest
motionharvest / js
Created May 20, 2016 02:25
Robotjs Script for moving the mouse around in a circle depending on a given degree
var Mathutils = {
//not so important
normalize: function ($value, $min, $max) {
return ($value - $min) / ($max - $min);
},
interpolate: function ($normValue, $min, $max) {
return $min + ($max - $min) * $normValue;
},
/*
@gaearon
gaearon / slim-redux.js
Last active December 3, 2024 06:34
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@octalmage
octalmage / spamhipchat.applescript
Last active January 18, 2017 16:25
Spam Hipchat.
delay 10
repeat 100 times
activate application "HipChat"
tell application "System Events" to keystroke "(parrot) (aussieparrot)"
tell application "System Events" to key code 76
delay 30
end repeat
@slogsdon
slogsdon / Dockerfile
Last active April 14, 2024 19:07
Simple Wordpress cluster backed by MySQL and a Redis object cache, all behind HAProxy
# Basic setup to copy Wordpress files,
# expected to be at '.', into the image
FROM orchardup/php5
ADD . /code
@alainmeier
alainmeier / mtgox.php
Created March 3, 2014 06:25
This is an alleged dump of some of MtGox.com's source code.
<?php
namespace Money;
class Bitcoin {
#const BITCOIN_NODE = '173.224.125.222'; // w001.mo.us temporary
const BITCOIN_NODE = '50.97.137.37';
static private $pending = array();
public static function update() {