Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am magj on github.
  • I am magj (https://keybase.io/magj) on keybase.
  • I have a public key ASDZVOaPNZ6iRN7nONtEz-GSGW-t65mVX9UdUOxsAgPBsQo

To claim this, I am signing this object:

@magJ
magJ / index.mjs
Created August 23, 2022 08:02
AWS-Lambda NodeJS Runtime extracted from public.ecr.aws/lambda/nodejs:16 /var/runtime/index.mjs
/** Copyright 2019,2020,2021,2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
// node_modules/lambda-runtime/dist/node16/index.mjs
import { createRequire } from "module";
var require2 = createRequire(import.meta.url);
var __getOwnPropNames = Object.getOwnPropertyNames;
var __require = /* @__PURE__ */ ((x) => typeof require2 !== "undefined" ? require2 : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require2 !== "undefined" ? require2 : a)[b]
}) : x)(function(x) {
if (typeof require2 !== "undefined")
return require2.apply(this, arguments);
@magJ
magJ / fzf_ctrl_t_preview.fish
Created July 3, 2018 05:50
Config options for inteligent preview using fzf on fish shell.
set -x FZF_CTRL_T_OPTS '--preview \'switch (file --mime {})
case "*inode/directory*"
ls -l {}
case "*binary*"
echo {} "is a binary file"
file {}
case "*"
highlight -O ansi -l {}; or cat {}| head -500
end\''
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.SimpleLayout;
import org.bouncycastle.openpgp.PGPException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
@magJ
magJ / InfiniteBlockRequest.java
Last active August 29, 2015 14:24
A demo of a request made by httpclient blocking forever, despite timeouts being set.
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.URI;