Skip to content

Instantly share code, notes, and snippets.

@Lerc
Lerc / index.html
Last active April 26, 2024 06:06 — forked from kahole/index.html
*scratch*.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>*scratch*</title>
<style>
body {
font-family: Hack, Menlo, Monaco, 'Droid Sans Mono', 'Courier New', monospace;
white-space: pre;
@surajp
surajp / dynaComp.html
Created August 15, 2023 17:27
Custom Elements in LWC
<template>
<h2>Dynamic Component</h2>
<div lwc:dom="manual" class="container"></div>
</template>
@kahole
kahole / index.html
Last active April 26, 2024 06:04
*scratch*.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>*scratch*</title>
<style>
body {
font-family: Hack, Menlo, Monaco, 'Droid Sans Mono', 'Courier New', monospace;
white-space: pre;
@ohownew
ohownew / 知识星球视频增强.js
Last active April 26, 2024 06:04
知识星球原生视频组件,无法通过键盘操作前进、后退、暂停、播放,于是写了一个简单的脚本,要先安装好篡改猴Tampermonkey等插件管理器。然后新建脚本,并复制如下代码
// ==UserScript==
// @name 知识星球视频增强
// @namespace http://tampermonkey.net/
// @version 2024-04-21
// @description 知识星球视频,通过键盘控制: 前进 后退 暂停 开始 全屏
// @author ohownew
// @match https://wx.zsxq.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=zsxq.com
// @grant none
// ==/UserScript==
<template>
<div class="slds-p-around_small">
<lightning-input label="Object Name" onchange={changeName}></lightning-input>
<lightning-input label="My Domain" onchange={changeDomain}></lightning-input>
<lightning-helptext content="Use document.cookie.match(/sid=([^;]*)/)[1] in the browser console after logging into SF" class="slds-p-right_xx-small"></lightning-helptext>
<lightning-input label="SessionId" onchange={changeSessionId}>
</lightning-input>
<lightning-textarea label="CSV Data"></lightning-textarea>
<lightning-button onclick={upload} label="upload"></lightning-button>
@manuelbl
manuelbl / README.md
Created August 3, 2019 09:12
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
# prompt: https://twitter.com/francoisfleuret/status/1783479122418716805
import os
os.environ['TORCH_LOGS'] = 'output_code' # shows all the bmms
import torch
torch.set_float32_matmul_precision('high')
N, T, D, U, C = 3, 128, 5, 32, 32 # batch, time, heads, head_dim, dim
S = T
A = torch.randn(N, T, D, U) / U**0.5
@madjo
madjo / converter.py
Created October 28, 2019 15:55
Convert {parquet | orc} to json and orc to parquet
#! /usr/bin/env python
import pandas as pd
import argparse
import os
import pyarrow.orc as orc
# usage: ./converter.py --help
CONVERTERS = ['parquet2json', 'orc2json', 'orc2parquet']
@TrevTV
TrevTV / ArcOn10.md
Last active April 26, 2024 05:59
Guide to installing Arc Browser on Windows 10

As this is not an official way of installing Arc, if you encounter any issues do NOT report them to the developers, they did not intend for people to be running Arc on Windows 10.

This guide is a bit more manual since I wanted to respect the developers' wishes and not directly link any downloads to the beta of Arc.

I don't know how this will work with updates, you may just need to redo the process to update it, but I'm not sure

  1. Install this font: https://aka.ms/SegoeFluentIcons (this fixes the icons since Windows 10 doesn't have this font installed by default)
  2. Download the Arc appinstaller and open it in notepad/some other text editor
  3. Copy everything inside and paste it into this website: https://codebeautify.org/xmlviewer (this is optional, but it makes reading and copying from the file easier)
  4. Find the mainpackage @Uri, it should end in Arc.x64.msix, and open that in a new tab. It should download that msix file.
@VictorTaelin
VictorTaelin / a_b_challenge.md
Last active April 26, 2024 05:56
A::B Prompting Challenge: $10k to prove me wrong!

CHALLENGE

Develop an AI prompt that solves random 12-token instances of the A::B problem (defined here), with 90%+ success rate.

RULES

1. The AI will be given a <problem/> to solve.

We'll use your prompt as the SYSTEM PROMPT, and a specific instance of problem as the PROMPT, inside XML tags. Example: