Skip to content

Instantly share code, notes, and snippets.

View dmikey's full-sized avatar
🕶️
Thug Life

Derek Anderson dmikey

🕶️
Thug Life
View GitHub Profile
{
"name": "Blockless Operator",
"website": "https://blockless.network/",
"description": "Creators of Blockless, a new way to interact with the blockchain.",
"logo": "https://raw.githubusercontent.com/blocklessnetwork/eigenlayer-avs-holesky/main/logo.png",
"twitter": "https://twitter.com/theblockless"
}
---
regions:
- "ap-northeast-1"
- "ap-northeast-2"
- "ap-northeast-3"
- "ap-south-1"
- "ap-southeast-1"
- "ap-southeast-2"
- "ca-central-1"
- "eu-central-1"
// resize gan example
func upscaleImage(_ orgImage: NSImage) -> NSImage {
let newSize = CGSize(width: 2048, height: 2048)
guard let cgImage = orgImage.cgImage(forProposedRect: nil, context: nil, hints: nil),
let resizedImage = resize(cgImage, to: newSize) else {
return orgImage
}
guard let model = try? VNCoreMLModel(for: realesrgan512(configuration: MLModelConfiguration()).model) else {
@dmikey
dmikey / pkcs10Generator.js
Created June 25, 2021 17:26 — forked from tcd93/pkcs10Generator.js
Simple way to generate certificate signing request (CSR) with X.509 using Javascript
import * as asn1js from 'asn1js';
import { getCrypto, getAlgorithmParameters, CertificationRequest, AttributeTypeAndValue } from 'pkijs/build'
import { arrayBufferToString, toBase64 } from 'pvutils';
//https://github.com/PeculiarVentures/PKI.js/blob/31c10e9bb879cac59d710102adf4fd7bd61cd66c/src/CryptoEngine.js#L1300
const hashAlg = 'SHA-256'
const signAlg = 'ECDSA'
/**
* @example
* createPKCS10({ enrollmentID: 'user1', organizationUnit: 'Marketing', organization: 'Farmer Market', state: 'M', country: 'V' })
@dmikey
dmikey / package.json
Created June 6, 2018 19:33
minimal package.json for webpack development
{
"name": "app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"serve": "webpack-dev-server --config webpack.config.js --content-base build/"
},
"author": "",
"license": "ISC",
@dmikey
dmikey / ipsec.conf
Created September 8, 2017 18:19
widely compatible strongSwan config
# ipsec.conf - strongSwan IPsec configuration file
config setup
charondebug="ike 4, knl 4, cfg 4, net 4, esp 4, dmn 4, mgr 4"
conn %default
keyexchange=ikev2
ike=aes128-sha1-modp1024,aes128-sha1-modp1536,aes128-sha1-modp2048,aes128-sha256-ecp256,aes128-sha256-modp1024,aes128-sha256-modp1536,aes128-sha256-modp2048,aes256-aes128-sha256-sha1-modp2048-modp4096-modp1024,aes256-sha1-modp1024,aes256-sha256-modp1024,aes256-sha256-modp1536,aes256-sha256-modp2048,aes256-sha256-modp4096,aes256-sha384-ecp384,aes256-sha384-modp1024,aes256-sha384-modp1536,aes256-sha384-modp2048,aes256-sha384-modp4096,aes256gcm16-aes256gcm12-aes128gcm16-aes128gcm12-sha256-sha1-modp2048-modp4096-modp1024,3des-sha1-modp1024!
esp=aes128-aes256-sha1-sha256-modp2048-modp4096-modp1024,aes128-sha1,aes128-sha1-modp1024,aes128-sha1-modp1536,aes128-sha1-modp2048,aes128-sha256,aes128-sha256-ecp256,aes128-sha256-modp1024,aes128-sha256-modp1536,aes128-sha256-modp2048,aes128gcm12-aes128gcm16-aes256gcm12-aes256gcm16-modp2048-modp4096-mo
module.exports = function(uri) {
// returns protocol://hostname:port/
var a = document.createElement('a');
a.href = endPoints.host;
return a.protocol + '//' + a.host + ':' + (a.port.length > 0 ? a.port : '80') +'/';
}
@dmikey
dmikey / task.json
Created April 6, 2016 06:02
vscode npm command
{
"version": "0.1.0",
"command": "npm",
"isShellCommand": true,
"tasks": [
{
"taskName": "run",
// Make this the default build command.
"isBuildCommand": true,
"args": ["build"],
@dmikey
dmikey / launch.json
Created March 31, 2016 05:07
example of vscode launch
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/index.js",
"stopOnEntry": false,
"args": [],
@dmikey
dmikey / component.js
Created December 24, 2015 12:01
componentize your JS easy.
'use strict';
module.exports = function(template, data) {
this.data = function(data) {
this.oldnode = this.node;
for (var k in data) {
this[k] = data[k];
};
this.tag = this.tag || 'div';