Skip to content

Instantly share code, notes, and snippets.

View octalmage's full-sized avatar

Jason Stallings octalmage

View GitHub Profile
@octalmage
octalmage / war.js
Created July 13, 2023 05:33
War for JAX
class WarContract {
init({ rng }) {
storage.put("rng", rng);
storage.put("id", 1);
}
can_update() {
return blockchain.requireAuth(blockchain.contractAdmin());
}
@octalmage
octalmage / Original Pokemon
Created October 11, 2013 15:30
I recently needed an array of the original 150 Pokemon. Somehow it didn't exist, so I thought I'd share it!
var Pokemon=new Array("Bulbasaur","Ivysaur","Venusaur","Charmander","Charmeleon","Charizard","Squirtle","Wartortle","Blastoise","Caterpie","Metapod","Butterfree","Weedle","Kakuna","Beedrill","Pidgey","Pidgeotto","Pidgeot","Rattata","Raticate","Spearow","Fearow","Ekans","Arbok","Pikachu","Raichu","Sandshrew","Sandslash","Nidoran","Nidorina","Nidoqueen","Nidoran","Nidorino","Nidoking","Clefairy","Clefable","Vulpix","Ninetales","Jigglypuff","Wigglytuff","Zubat","Golbat","Oddish","Gloom","Vileplume","Paras","Parasect","Venonat","Venomoth","Diglett","Dugtrio","Meowth","Persian","Psyduck","Golduck","Mankey","Primeape","Growlithe","Arcanine","Poliwag","Poliwhirl","Poliwrath","Abra","Kadabra","Alakazam","Machop","Machoke","Machamp","Bellsprout","Weepinbell","Victreebel","Tentacool","Tentacruel","Geodude","Graveler","Golem","Ponyta","Rapidash","Slowpoke","Slowbro","Magnemite","Magneton","Farfetch'd","Doduo","Dodrio","Seel","Dewgong","Grimer","Muk","Shellder","Cloyster","Gastly","Haunter","Gengar","Onix","Drowzee","Hyp
@octalmage
octalmage / sine.js
Created October 18, 2015 14:55
RobotJS - Move the mouse across the screen as a sine wave.
//Move the mouse across the screen as a sine wave.
var robot = require("robotjs");
//Speed up the mouse.
robot.setMouseDelay(2);
var twoPI = Math.PI * 2.0;
var screenSize = robot.getScreenSize();
var height = (screenSize.height / 2) - 40;
var width = screenSize.width;
@octalmage
octalmage / roles.md
Last active May 14, 2023 17:43
Default WordPress user roles and capabilities.

WordPress v4.3.1

Admin wp_capabilities wp_user_level 10

a:1:{s:13:"administrator";b:1;}

Contributor wp_capabilities wp_user_level 1

@octalmage
octalmage / robotjs_alt_tab.js
Created August 11, 2015 10:01
RobotJS - Automate Alt+Tab.
var robot = require("robotjs");
var sleep = require("sleep");
robot.keyToggle('tab', true, 'command');
robot.keyTap('tab', 'command');
sleep.sleep(2);
robot.keyTap('tab', 'command');
sleep.sleep(2);
robot.keyTap('tab', 'command');
@octalmage
octalmage / deploy.yaml
Created April 5, 2023 22:48
Deploy your own https://gun.eco relay node on Akash.
---
version: '2.0'
services:
gundb:
image: gundb/gun
expose:
- port: 8765
as: 80
# Uncomment to add your own domain.
# accept:
@octalmage
octalmage / keplr.js gist
Last active September 19, 2022 16:49 — forked from clevinson/keplr.js gist
DO NOT RUN THIS
{
"chainId": "phoenix-1",
"chainName": "Terra 2.0",
"rpc": "https://terra-rpc.polkachu.com/",
"rest": "https://phoenix-lcd.terra.dev/",
"stakeCurrency": {
"coinDenom": "LUNA",
"coinMinimalDenom": "uluna",
"coinDecimals": 6,
"coinGeckoId": "terra-luna"
@octalmage
octalmage / clearcart.php
Created October 26, 2015 07:00
Force clear WooCommerce cart for WordPress user.
<?php
add_action( 'init', 'force_clear_woocommerce_cart' );
function force_clear_woocommerce_cart()
{
$user_ID = get_current_user_id();
if ($user_ID === 68364)
{
@octalmage
octalmage / virus.sol
Created July 2, 2021 20:25
Virus ERC20 Token
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
@octalmage
octalmage / play_music.h
Created December 8, 2014 18:53
Google Music Class Dump - iOS
/*
* Generated by class-dump 3.1.2.
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2007 by Steve Nygard.
*/
struct CATransform3D {
float _field1;
float _field2;
float _field3;