Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🍳
Cooking up great code

Nathan LeClaire nathanleclaire

👨‍🍳
Cooking up great code
View GitHub Profile
View karma_token.diff
diff --git a/Anchor.toml b/Anchor.toml
index 9bf3ac1..9e62d44 100644
--- a/Anchor.toml
+++ b/Anchor.toml
@@ -2,7 +2,7 @@
seeds = false
[programs.localnet]
-karma = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
+karma_token = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
View solfees.js
(async () => {
console.log('LFG');
const startBlock = 117416695;
const blocks = range(startBlock, startBlock + 100000);
let fees = 0;
for (const i of blocks.values()) {
try {
const solConn = new sol.Connection(
'solapi.com',
View airdrop_fail.md

with cli tools:

$ solana airdrop 1 --url localhost
Requesting airdrop of 1 SOL
Error: airdrop request failed. This can happen when the rate limit is reached.

rpc logs:

View solana_problem.md
$ solana-keygen new --outfile ~/my-solana-wallet/my-keypair2.json
Generating a new keypair

For added security, enter a BIP39 passphrase

NOTE! This passphrase improves security of the recovery seed phrase NOT the
keypair file itself, which is stored as insecure plain text

BIP39 Passphrase (empty for none): thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 6, kind: Other, message: "The handle is invalid." }', keygen\src/keygen.rs:574:92
@nathanleclaire
nathanleclaire / ffmpeg_dark_magic.md
Created Jun 27, 2021
Encode YouTube compatible video file of just one image with audio using ffmpeg
View ffmpeg_dark_magic.md

Trying to crank out a video which is:

  1. YouTube compatible
  2. Small-ish
  3. Preserves lossless audio
  4. Doesn't crash VLC, etc. (this happened embedding a FLAC direct in a WMV)
  5. Encodes as quickly as possible

So far, the best I've come up with is as follows:

View OTelSpan.java
Span span = tracer.scopeManager().activeSpan();
span.setAttribute("metric_name", "metric_value");
View garch.py
#Import Requirements-----------------------------------------------------------
from arch import arch_model
import datetime as dt
from datetime import datetime, timedelta
import pandas as pd
from yahoo_fin import stock_info as si
#Set Date Range----------------------------------------------------------------
start = dt.datetime(2000,1,1)
View beeline_test.js
var http = require('http');
var beeline = require('honeycomb-beeline')({
writeKey: "key",
dataset: "nathanleclaire.nodejsbeelinetest",
serviceName: "frameworks-are-bloated-http-directly-rules"
});
//create a server object:
http.createServer(function (req, res) {
let trace = beeline.startTrace();
@nathanleclaire
nathanleclaire / Dockerfile
Last active Jul 17, 2020
Secure Tenancy on Kubernetes
View Dockerfile
FROM debian:stretch-slim
RUN mkdir -p /srv/hny && \
apt-get update && \
apt-get install -y ca-certificates openssl bzip2
WORKDIR /srv/hny
# Need to build with tarball (provided by HNY team) adjacent in docker build directory
COPY st.tbz st.tbz
RUN tar --strip-components 1 -xjf st.tbz && \
@nathanleclaire
nathanleclaire / DebugResponseObserver.java
Created Mar 10, 2020
Generic filter with context injection - Honeycomb Java Beeline implementation
View DebugResponseObserver.java
package com.mycompany.config.filters;
import io.honeycomb.libhoney.ResponseObserver;
import io.honeycomb.libhoney.responses.ClientRejected;
import io.honeycomb.libhoney.responses.ServerAccepted;
import io.honeycomb.libhoney.responses.ServerRejected;
import io.honeycomb.libhoney.responses.Unknown;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;