Skip to content

Instantly share code, notes, and snippets.

View adamstallard's full-sized avatar
🪁

Adam Stallard adamstallard

🪁
View GitHub Profile
@adamstallard
adamstallard / OnchainMedianVote.md
Last active December 19, 2024 15:52
Keeping a running median vote on chain
const CryptoJS = require("crypto-js");
const nacl = require("tweetnacl");
const B64 = require("base64-js");
const { create } = require("apisauce");
const assert = require("assert");
const qrcode = require("qrcode-terminal");
const baseURL = "http://test.brightid.org/profile";
const api = create({
baseURL,
@adamstallard
adamstallard / attr-string-template-pre.xhtml
Last active August 26, 2023 10:50
How to reuse part of an attribute string in modest.
<?xml version='1.0' encoding='UTF-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<include>myImage</include>
</head>
<body>
<myImage>
<base>..</base>
</myImage>
</body>
@mcgaffin
mcgaffin / gist:3873928
Created October 11, 2012 17:03
iOS: how to get the ip address of a remote host.
// adapted from: http://blog.zachwaugh.com/post/309927273/programmatically-retrieving-ip-address-of-iphone
- (NSString *)getIPAddress {
Boolean result;
CFHostRef hostRef;
CFArrayRef addresses;
NSString *hostname = @"domain.myhost.com";
NSString *ipAddress = @"";
hostRef = CFHostCreateWithName(kCFAllocatorDefault, (CFStringRef)hostname);
if (hostRef) {
@danielestevez
danielestevez / gist:2044589
Last active November 6, 2025 20:14
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}