Skip to content

Instantly share code, notes, and snippets.

View jacob414's full-sized avatar
💭
Retired but semi-active, hobby projects & activism

Jacob Oscarson jacob414

💭
Retired but semi-active, hobby projects & activism
View GitHub Profile
@Xion
Xion / lambdacode.py
Last active September 6, 2024 11:24
Retrieve source code of a (short) lambda -- http://xion.io/post/code/python-get-lambda-code.html
import ast
import inspect
import os
def get_short_lambda_source(lambda_func):
"""Return the source of a (short) lambda function.
If it's impossible to obtain, returns None.
"""
try:
@longle255
longle255 / ngrok-selfhosting-setup.md
Last active February 14, 2019 10:52 — forked from lyoshenka/ngrok-selfhosting-setup.md
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

@gigamonkey
gigamonkey / start-coding.md
Last active January 18, 2016 08:49
Answer to email asking how to start learning to code

There are a bunch of ways to start. The main thing is to get some simple programming environment where you can try things and learn from your mistakes. Depending on how you like to learn you might want to start with a good book. I haven't read it myself but I've heard good things about How to Design Programs which you can read online here http://www.htdp.org/. There are also sites like https://www.codecademy.com/ and https://studio.code.org/ that have online instruction for starting programming. The latter may be aimed somewhat at kids but that doesn't really matter.

Another approach is to start by learning HTML, the language used to make web pages, which is not exactly a programming language but which will let you play with making a computer do something as well as giving you a chance to learn some of the mechanics of dealing with files and debugging your mistakes, etc. From there you can learn to make web pages more dynamic with Javascript, which is a programming language. In this case your programming e

@gene1wood
gene1wood / example_aws_lambda_cloudformation_context.md
Last active April 11, 2025 18:04
Details on the AWS Lambda Python LambdaContext context object when instantiated from a CloudFormation stack

LambdaContext

Here is the raw output from examining the Python LambdaContext context object in a AWS Lambda function when called from a CloudFormation stack. More information on the context object can be found here : http://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html

LambdaContext object : print(context)

<__main__.LambdaContext object at 0x7fd706780710>

LambdaContext vars : vars(context)

@foxxyz
foxxyz / nginx.conf
Last active March 3, 2024 10:42
Serve current directory via nginx
# Extremely basic development setup to serve the current directory at http://localhost:9001
# Start nginx in this directory with `nginx -p . -c nginx.conf`
# Stop nginx with `nginx -p . -s stop`
events {}
http {
# Serve files with correct mimetypes on OSX
# location may have to be adjusted depending on your OS and nginx install
include /usr/local/etc/nginx/mime.types;
(*
INTRODUCTION TO OCAML
Fredrik Dyrkell
@lexicallyscoped
www.lexicallyscoped.com

Learning OCaml

Similarly to what exists for Haskell, I wanted to make a curated collection of good resources for getting started with OCaml.

Installation and getting started

Follow the installation instructions from the Real World OCaml book available here. This will get you accustomed to

  • Opam, the package manager, which also gives to the possibility of switching between OCaml versions.
  • Utop, a modern interactive toplevel
  • Set up of your enviroment, in particular #use "topfind" so that Utop finds your packages installed by Opam.
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active March 29, 2025 07:56
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@jwreagor
jwreagor / EmacsKeyBinding.dict
Created March 20, 2014 18:41
Global Emacs Key Bindings for OS X
{
/* Keybindings for emacs emulation. Compiled by Jacob Rus.
*
* This is a pretty good set, especially considering that many emacs bindings
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and
* perhaps a few more, are already built into the system.
*
* BEWARE:
* This file uses the Option key as a meta key. This has the side-effect
* of overriding Mac OS keybindings for the option key, which generally