Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Kelly mikekelly

View GitHub Profile
@mikekelly
mikekelly / getPubKey.js
Created Feb 1, 2022 — forked from chrsengel/getPubKey.js
Attempting to get the public key
View getPubKey.js
const ethers = require("ethers")
const pk =
"0x0471c746523d16e93d4738f882d9b0beebf66c68caa0f895db15686b57b878cfc7b3e09813ba94f1bbfaa91a06566d3d18bbf69d10bcc947325bbcd6fea97ed692"
const ad = "0xcD3edF915387E2555A829567cE0dBbC919834B82"
getPubKey = async () => {
const infuraProvider = new ethers.providers.JsonRpcProvider(
"https://ropsten.infura.io/v3/<projectID>"
)
@mikekelly
mikekelly / pksc7_verify.rb
Created Mar 19, 2021 — forked from zmajstor/pksc7_verify.rb
OpenSSL::PKCS7#verify test
View pksc7_verify.rb
require 'openssl'
require 'base64'
require "test/unit"
BODY = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>Status</key>\n\t<string>Idle</string>\n\t<key>UDID</key>\n\t<string>b7ebaaa53fda9be2f7787eff7c1f4aca4e36f79d</string>\n</dict>\n</plist>\n"
SIGNATURE_BASE64 = "MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIIHTCCA20wggJVoAMCAQICEESzOh1IytmdQqbap8VUON0wDQYJKoZIhvcNAQEFBQAwSTETMBEGCgmSJomT8ixkARkWA25ldDEWMBQGCgmSJomT8ixkARkWBnByb21kbTEaMBgGA1UEAxMRUHJvbWRtTkVUUm9vdENBdjEwHhcNMTIwOTI1MDgyODI2WhcNMzIwOTI1MDgzODI1WjBJMRMwEQYKCZImiZPyLGQBGRYDbmV0MRYwFAYKCZImiZPyLGQBGRYGcHJvbWRtMRowGAYDVQQDExFQcm9tZG1ORVRSb290Q0F2MTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN43J/4Pimp7CEO7mA7V9A+Dj9NX1Cz0x97SncGqkh+x1xz6Ofoiq9vV2UC5DYIvGf3VVWErPwSXVQJ1Jd/uksCkVktC9zUfInYTb8dSGZ3MdrIntT83XWCkzPAjPZHOicBvU0hRCoY6r/FoQbVAIH+FnuEaGmXM+SYVbed6OLf3RN3DJPFw7y0xiJr3DRg
@mikekelly
mikekelly / ruby_cert.rb
Created Feb 28, 2021 — forked from VimleshS/ruby_cert.rb
Usage examples of ruby’s openssl lib
View ruby_cert.rb
#Reference
#https://devnotcorp.wordpress.com/2012/08/21/usage-examples-of-rubys-openssl-lib/
#!/usr/bin/ruby
require 'openssl'
require 'date'
require 'time'
View example.halo.json
{
"_links":{
"self":{
"href":"/users"
}
},
"_forms":{
"create-user":{
"title":"Create a new widget",
"description":"Enter your widget info and submit to create a new widget",
View users_controller_service.rb
class UsersController < ApplicationController
def create
CreateUserService.new.call(
params[:user],
on_success: public_method(:create_successful),
on_failure: public_method(:create_failure)
)
end
def create_successful(user)
View undecidability.md

I believe that if we are honest with ourselves, that the most fascinating problem in the world is “who am I?” What do you mean? What do you feel when you say the word “I, myself”? I don’t think there can be anymore fascinating preoccupation than that because it is so mysterious. It is so elusive. Because what you are in your inmost being escapes your examination in rather the same way you cant look into your own eyes without a mirror, you can’t bite your own teeth, you can’t taste your own tongue and you can’t touch the end of one finger with the same finger. That is why there is always an element of profound mystery in the problem of who we are."

-- Alan Watts

View README.md
@mikekelly
mikekelly / hal-example.xml
Created May 27, 2011
Example usage of the media type application/hal+xml
View hal-example.xml
<resource rel="self" href="/" xmlns:ex="http://example.org/rels/">
<link rel="ex:look" href="/bleh" />
<link rel="ex:search" href="/search?term={searchTerm}" />
<resource rel="ex:member" name="1" href="/foo">
<link rel="ex:created_by" href="/some_dude" />
<example>bar</example>
<resource rel="ex:status" href="/foo;status">
<some_property>disabled</some_property>
</resource>
</resource>
@mikekelly
mikekelly / base_consumer.rb
Last active Nov 13, 2015
A better consumer interface for hutch consumers
View base_consumer.rb
require 'hutch'
class BaseConsumer
# Ensure subclass is passed to Hutch::Consumer.included
def self.inherited(subclass)
subclass.include Hutch::Consumer
end
# Option to initialize a consumer with a message
def initialize(message: nil)