Skip to content

Instantly share code, notes, and snippets.

View einaralex's full-sized avatar
🐕

Einar Alexander Eymundsson einaralex

🐕
View GitHub Profile
@einaralex
einaralex / safesign.tsx
Last active March 6, 2024 16:47
Manually trigger Safe on-chain signature
import { getSignMessageLibDeployment } from '@gnosis.pm/safe-deployments';
import SafeApiKit from '@safe-global/api-kit';
import Safe, {
EthersAdapter,
hashSafeMessage,
} from '@safe-global/protocol-kit';
import {
OperationType,
SafeTransactionDataPartial,
} from '@safe-global/safe-core-sdk-types';
@einaralex
einaralex / go
Created April 29, 2023 22:26
Oapi-codegen
// Package monerium provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
package monerium
import (
"bytes"
"compress/gzip"
"context"
"encoding/base64"
@einaralex
einaralex / tsc-vscode-terminal-error.txt
Last active June 26, 2021 12:06
[ import { BoxKeyPair, SignKeyPair } from "tweetnacl" ] - [ import FormData = require('form-data'); ] - [ error TS5042: Option 'project' cannot be mixed with source files on a command line. ]
Got these strange errors when running `tsc`, this error only seems to appear in the VSCode terminal.
Just open up a terminal/shell that is not attached to VSCode and try again.
MORE ON THE ERRORS:
__________________
error TS2792: Cannot find module 'tweetnacl'.
Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
@einaralex
einaralex / captcha.html
Created November 12, 2020 15:05
Cloudflare custom captcha error - next.js
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;" charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/><title>Verification | example</title><link rel="icon" sizes="180x180" href="https://www.example.com/favicon.ico"/><link rel="preload" href="./_next/static/css/21eaf7d6ef104c4e7ac4.css" as="style"/><style>body,div#__next,html{height:100%}div#__next{height:100vh}body,div#__next{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column}body{font-family:AltitudeWeb,Arial,sans-serif;font-weight:500;line-height:1.375;position:relative;min-height:70vh;margin:0;padding:0;color:#5e5e5e;background:#f4f4f4;-webkit-justify-content:space-between;justify-content:space-between;font-size:0}</style><link rel="preload" href="./_next/static/css/bbec92b2749b268e29fb.css" as="style"/><style>.header_header__3Qn1F{z-index:1;top:0;right:0;left:0;padding:10px;border-bottom:1px solid #e5e5e5;background:#f
@einaralex
einaralex / gist:34b9ccb64e59ad6808f6c4a4580cf834
Created August 28, 2019 23:13
copy files with structure
// This script takes fromFolder, toFolder and a fileType
// it finds all files of the fileType in fromFolder and copies it to toFolder
// there is something wrong with how the path is resolved if the fromFolder does not exist
const glob = require('glob');
const fs = require('fs');
const path = require('path');
const fromFolder = process.argv[2] || 'src';
const toFolder = process.argv[3] || 'dist';

Keybase proof

I hereby claim:

  • I am einaralex on github.
  • I am einaralex (https://keybase.io/einaralex) on keybase.
  • I have a public key ASCuk9Dj226VdM8R21_xFQM4_OsMO264Pjss6cXr7xMGLAo

To claim this, I am signing this object:

@einaralex
einaralex / client.html
Last active March 18, 2019 16:19
Client bundles 18.03.19
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Webpack Bundle Analyzer</title>
<!-- viewer.js -->
<script>
type Address {
PartnerCode: ID
FullName: String
AddressType: String
Address1: String
Address2: String
Address3: String
Address4: String
PointCode: String
PostCode: String
set "PATH=%ConEmuDrive%\Program Files\Git\usr\bin;%PATH%" & "%ConEmuDrive%\Program Files\Git\git-cmd.exe" --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe /usr/bin/bash.exe -l -i -new_console:a
@einaralex
einaralex / callablestatement.java
Created August 9, 2017 14:49
Calling a DB procedure that returns a cursor (Jmeter - Beanshell sampler)
import java.sql.*;
import oracle.jdbc.*;
import org.apache.jmeter.protocol.jdbc.config.DataSourceElement;
ResultSet rs = null;
ResultSetMetaData rsmd = null;
CallableStatement stmt;
// "myConnectionConfigName" is the variable name declaired in the 'JDBC Connection Configuration'
Connection conn = DataSourceElement.getConnection("myConnectionConfigName");