Skip to content

Instantly share code, notes, and snippets.

View octalmage's full-sized avatar

Jason Stallings octalmage

View GitHub Profile
@markjaquith
markjaquith / gist:2653957
Created May 10, 2012 15:36
WordPress Fragment Caching convenience wrapper
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
@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.

@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() {
@bergie
bergie / .gitignore
Created September 19, 2011 15:50
Node.js email handling examples
config.json
reading-image.png
@carlosleopoldo
carlosleopoldo / delete-orphans-usermeta.sql
Last active June 16, 2023 13:23
Delete all orphans user meta in WordPress
DELETE FROM wp_usermeta
WHERE NOT EXISTS (
SELECT * FROM wp_users
WHERE wp_usermeta.user_id = wp_users.ID
)
@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"
@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 =
'
&lt;div class="input"&gt;&lt;label for="input_api_username"&gt;Api Username: &lt;/label&gt;&lt;input placeholder="Api Username" id="input_api_username" name="input_api_username" type="text" size="20"&gt;&lt;/div&gt;
' +
'
&lt;div class="input"&gt;&lt;label for="input_api_hmackey"&gt;Api Key: &lt;/label&gt;&lt;input placeholder="ApiKey" id="input_api_hmackey" name="input_api_hmackey" type="text" size="20"&gt;&lt;/div&gt;
@FiloSottile
FiloSottile / 32.asm
Last active March 23, 2024 12:28
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@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
@ericclemmons
ericclemmons / example.md
Last active April 24, 2024 18:09
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