Skip to content

Instantly share code, notes, and snippets.

@donpdonp
donpdonp / darksky.js
Last active January 10, 2019 01:46
gluon darksky
(function() {
// setup
setup()
// descriptor
return {name:"darksky"}
})
var api_key
function setup() {
@donpdonp
donpdonp / inline-public.js
Last active October 28, 2019 21:27
gluon inline public
(function() {
// descriptor
return {name:"inline-public"}
})
function go(msg){
if(msg.method == "irc.privmsg") {
if(msg.params.nick != bot.owner) {
var match = /(.*){{(.*)}}(.*)/.exec(msg.params.message)
if(match){
const Module = struct {
sp: i32,
memory: Memory,
};
const Memory = struct {
ram: []i32,
};
pub fn main() void {
@donpdonp
donpdonp / freeze.js
Last active May 1, 2020 18:52
gluon freeze watch
(function() {
alerting_cache()
return {name:"freeze"}
})
var alert_channel = "#pdxbots"
var minor_channel = "#zrobo"
var freezing = false
var flip_time
var inwarming = false
@donpdonp
donpdonp / promise.js
Last active December 19, 2018 18:25
gluon promise test
(function() {
return {name:"promise"}
})
var promises = []
function go(msg) {
if (msg.method == "irc.privmsg") {
var match = /^!?promise$/.exec(msg.params.message)
if(match) {
@donpdonp
donpdonp / sslcheck.sh
Created December 13, 2018 19:04
~/.zsh/cmd/sslcheck
sslcheck () {
if [ -z "$1" ]
then
echo "sslcheck <domain name>"
else
name="${(s.:.)1}"
now_epoch=$( date +%s )
dig +noall +answer $name | while read _ _ _ _ ip
do
echo -n "$ip:"
pragma solidity ^0.4.24;
contract PriceOracleInterface {
/**
* @notice Gets the price of a given asset
* @dev fetches the price of a given asset
* @param asset Asset to get the price of
* @return the price scaled by 10**18, or zero if the price is not available
*/
function assetPrices(address asset) public view returns (uint);
pragma solidity ^0.4.24;
contract ErrorReporter {
/**
* @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary
* contract-specific code that enables us to report opaque error codes from upgradeable contracts.
**/
event Failure(uint error, uint info, uint detail);
enum Error {
// hevm: flattened sources of src/tub.sol
pragma solidity ^0.4.18;
////// lib/ds-guard/lib/ds-auth/src/auth.sol
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU 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,
pragma solidity ^0.4.24;
// produced by the Solididy File Flattener (c) David Appleton 2018
// contact : [email protected]
// released under Apache 2.0 licence
contract ErrorReporter {
/**
* @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary
* contract-specific code that enables us to report opaque error codes from upgradeable contracts.
**/