Skip to content

Instantly share code, notes, and snippets.

@imba-tjd
imba-tjd / .Cloud.md
Last active April 26, 2024 09:45
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@Sachin-chaurasiya
Sachin-chaurasiya / useAutoSizeTextArea.ts
Last active April 26, 2024 09:45
A simple custom hook to automatically resize the text area based on the content
import { useLayoutEffect } from 'react';
const useAutoSizeTextArea = (
id: string,
textAreaRef: HTMLTextAreaElement | null,
value: string
) => {
// this will calculate the height of textArea before DOM paints
useLayoutEffect(() => {
const textArea = textAreaRef ?? document.getElementById(id);
@gbalduzzi
gbalduzzi / app_attest_verification.php
Last active April 26, 2024 09:45
Apple App Attest verification
<?php
const PACKAGE_NAME = 'com.your.bundle_id';
const APPLE_TEAM_ID = 'ABCDEFGHIJK'; // 11 alphanumeric team ID
const ALLOW_DEV_ENVIRONMENT = true;
use CBOR\Decoder;
use CBOR\StringStream;
@subfuzion
subfuzion / curl.md
Last active April 26, 2024 09:43
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@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();