Skip to content

Instantly share code, notes, and snippets.

@MichaelCurrin
MichaelCurrin / README.md
Last active March 5, 2024 22:06
GitHub GraphQL - Get files in a repository

Get GitHub Files

Get the metadata and content of all files in a given GitHub repo using the GraphQL API

You might want to get a tree summary of files in a repo without downloading the repo, or maybe you want to lookup the contents of a file again without download the whole repo.

The approach here is to query data from GitHub using the Github V4 GraphQL API.

About the query

Easy Scala Publication

The following describes how you can publish artifacts for any sbt project using the GitHub Package Registry and the sbt-github-packages plugin.

Step 1: Create a GitHub Token

In your GitHub account, go to Settings > Developer settings > Personal access tokens, then click on Generate new token (or click here). Fill in some sort of meaningful name (I chose Dev) and click on the write:packages checkbox:

the new personal access token page with the above steps having been followed

@shadaj
shadaj / scalapy-tensorflow.ipynb
Last active November 27, 2020 23:56
ScalaPy TensorFlow.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@m-sp
m-sp / nativeScalafmt.md
Last active April 24, 2018 00:46
Compiling scalafmt to a native binary with graal

Graal contains an AOT compiler which makes it really straight forward to compile jars to native binaries. I've currently only tried the community edition on linux. So your mileage may vary.

Requirements

Create native binary

@softprops
softprops / steps.txt
Created April 9, 2018 05:41
Steps to build an awesome ecosystem
1. have a brilliant idea for something you want to use
2. Stop! Don't start building it.
3. Find a project that does something similar. (This likely exists)
4. Read it's documentation.
* If it has none, learn the project and create some.
* If it does, try to build something with it and document what wasn't clear.
5. If it feels broke. Write some failing tests,
* If possible, fix them, then open a pr
* If not, open a pr with failing tests and get the maintainer to teach you how to fix them
6. Document your process for contributing in a file called CONTIBUTING.md
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const url = require("url");
let net = require('net'), fs = require('fs'), os = require('os'), stdin = process.stdin, stdout = process.stdout;
let u = discoverUrl();
let socket = net.Socket();
socket.on('data', (chunk) => {
// send it back to stdout
stdout.write(chunk);

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@smarter
smarter / gadt.md
Last active March 6, 2024 23:33
GADTs in Scala

Generalized Algebraic Data Types in Scala

Basic GADTs

Here's an ADT which is not a GADT, in Haskell:

data Expr = IntExpr Int | BoolExpr Bool