Skip to content

Instantly share code, notes, and snippets.

View octalmage's full-sized avatar

Jason Stallings octalmage

View GitHub Profile
@octalmage
octalmage / release.md
Last active March 12, 2020 19:52
Local v5.2.6 Beta
@octalmage
octalmage / ico.js
Last active February 28, 2020 01:41
IOST ICO Example
const TOKEN = 'TIX';
const IOST_COST = '.1';
const TOKEN_DECIMALS = 8;
class ICO {
init() {
// Runs on deploy.
}
// Remove to disable updates.
@octalmage
octalmage / wax.js
Created February 7, 2020 19:54
Checking the inline calls of a transaction.
const tx = await theWallet.transact({
actions: [{
account: 'blockarcade1',
name: 'result',
authorization: [{
actor: theAccount,
permission: 'active',
}],
data: {
customer_string: userID,
@octalmage
octalmage / bid.yaml
Last active June 22, 2019 21:46
Sonm Web Server bid.yaml
duration: 0
price: 0.01 USD/h price: 1 USD/h
identity: anonymous
tag: wp
resources:
network:
overlay: true
outbound: true
@octalmage
octalmage / custom_timeout.php
Created July 14, 2016 18:38
PHP Compatibility Custom Timeout
<?php
/*
Plugin Name: PHP Compatibility Custom Timeout
*/
function custom_timeout( $timeout ) {
return 0;
}
add_filter( 'wpephpcompat_scan_timeout', 'custom_timeout', 10 );
@octalmage
octalmage / index.js
Last active September 6, 2018 19:15 — forked from salami-art/index.js
import React from 'react'
// import { Link } from 'gatsby'
import Layout from '../components/layout'
import PostsList from '../components/posts_list'
import PostsFilter from '../components/posts_filter'
const IndexPage = (data) => {
console.log('Index.js', data.length)
return (
<Layout>
@octalmage
octalmage / hex.c
Created July 18, 2015 15:39
C padding code - Pad a hex value with leading zeros.
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
int main()
{
int hex = 11100;
//Get length of hex.
int dlen = floor(log10(abs(hex))) + 1;
@octalmage
octalmage / screen.js
Created October 6, 2015 21:39
RobotJS screen capture API preview.
var robot = require("robotjs");
var image = robot.screen.capture();
var hex = image.colorAt(25, 25);
console.log("#" + hex);
//#ebebeb
@octalmage
octalmage / autorestart.sh
Created September 11, 2014 04:51
Automatically restart HHVM if a url is returning a 502. I'm using the HHVM nightlies to take advantage of some new features, but it will occasionally stop responding to requests. Add this to your crontab to run every minute.
#!/bin/bash
response=$(curl -L --write-out %{http_code} --silent --output /dev/null jason.stallin.gs);
echo $response
if [ "$response" = "502" ]
then
service hhvm restart
fi
@octalmage
octalmage / alsoviewing.user.js
Last active August 24, 2017 18:05
WordPress.org Also Viewing Greasemonkey userscript. https://github.com/octalmage/WordPress.org-Also-Viewing
// ==UserScript==
// @name WordPress.org Also Viewing
// @namespace http://jason.stallin.gs
// @description See when another person is viewing the same post.
// @include https://wordpress.org/support/topic/*
// @require https://code.jquery.com/jquery-1.11.0.min.js
// @require https://viewing-server.herokuapp.com/socket.io/socket.io.js
// @version 0.1.0
// ==/UserScript==