Skip to content

Instantly share code, notes, and snippets.

@BretFisher
BretFisher / docker-for-mac.md
Last active April 26, 2024 09:38
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.MotionEvent
import android.view.View
import android.webkit.WebView
import androidx.customview.widget.ViewDragHelper
class NestedScrollingWebView @JvmOverloads constructor(context: Context,
attrs: AttributeSet? = null) : WebView(context, attrs) {
@7645re
7645re / JetBrainsActivation.md
Last active April 26, 2024 09:37
JetBrains Activation MacOS/Windows

1. Proxifier method

Right now, the easiest way to activate JetBrains products is to use redirection of all requests from the application to localhost, but then nothing will work for you, neither pull/push git nor other plugins that use Internet access.

There is a better way, we will forward requests only to those that will go to the address account.jetbrains.com. This can be done without using the program, but it seems to me the easiest way to do it is through Proxifier. This program is available for both Windows and macOS.

@veekaybee
veekaybee / normcore-llm.md
Last active April 26, 2024 09:36
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();

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.

@tarleb
tarleb / list-formats.lua
Last active April 26, 2024 09:34
list-formats.lua
--- Lists the formats that support all the extensions given on the command line.
--
-- Usage:
--
-- pandoc lua list-formats.lua [extensions,...]
--
-- Example:
--
-- $ pandoc lua list-formats.lua native_numbering citations
-- docx
@vistamedia
vistamedia / migrate.php
Last active April 26, 2024 09:32
Migration example for Louis
<?php
// BOF MANU
// $old => $new
$categories = array(
1 => 3,
2 => 4,
3 => 5,
4 => 6,
5 => 7,
6 => 8,
@johndavedecano
johndavedecano / .gitlab-ci.yml
Last active April 26, 2024 09:32
CI/CD for ReactJS Application using GITLAB
cache:
paths:
- node_modules/
- .yarn
stages:
- build
- test
- deploy
build:
image: node:10
@jjakob
jjakob / Building_openmediavault_5_on_Buster.md
Last active April 26, 2024 09:30
Guide for building Openmediavault 5 on Debian Buster

This guide is only for Debian Buster (10) as of 2019-01-07. It was tested on a mipsel system (GnuBee PC2).

  1. Enable buster-backports (needed for monit)
echo "deb http://httpredir.debian.org/debian buster-backports main" >> /etc/apt/sources.list
apt-get update
  1. Install prerequisites