Skip to content

Instantly share code, notes, and snippets.

@ficapy
ficapy / codesandbox_private.js
Created May 13, 2024 07:00
change all codesandbox public to private
const id = "YOUR ID";
const query = `
query TeamSidebarData($id: UUID4!) {
me {
team(id: $id) {
sandboxes(limit: 200, orderBy: {field: "updatedAt", direction: DESC}) {
...sandboxFragmentDashboard
}
}
}
@ficapy
ficapy / simd.c
Last active December 6, 2023 09:58
mojo simd
#include <stdio.h>
#include <x86intrin.h>
// gcc -msse4.1 -O0 -o program program.c
int main() {
__m128i A = _mm_set_epi32(4, 3, 2, 1);
__m128i B = _mm_set_epi32(8, 7, 6, 5);
__m128i Cond = _mm_set_epi32(0, -1, -1, 0);
__m128i Result = _mm_blendv_epi8(A, B, Cond);
https://easylearn.baidu.com/edu-page/tiangong/exercisedetail?id=69691b1ff142336c1eb91a37f111f18583d00cfc&stfrom=aladdin
标准答案: 1 C; 2 A; 3 D; 4 D; 5 A; 6 B; 7 C; 8 B
总结:
ChatGPT+WolfAlpha: 6分(解答6题,2题明确表示无法解答)
Google Bard: 4分
1. 以下为中国高考数学单选题,在给出的四个选项中,只有一个是对的,先配合wolfalpha尝试解答,再给出哪个答案是正确答案
已知集合$M=\{-2,-1,0,1,2\}$,$N=\{x\mid x^{2}-x-6\geq0\}$,则$M\cap N=$
A: $\{-2,-1,0,1\}$
B: $\{0,1,2\}$
C: $\{-2\}$
  1. create a file /etc/init.d/clash
#!/sbin/openrc-run

command="/root/clash-linux-amd64-v3-2022.11.25"
command_args="-f /root/config.yaml"

depend() {
        need net
 after firewall
#include <Python.h>
static PyObject * fibonacci_fib(PyObject *self, PyObject *args) {
int n;
if (!PyArg_ParseTuple(args, "i", &n)) {
return NULL;
}
int i;
int a = 0;
int b = 1;
@ficapy
ficapy / UTF8_BOM.go
Created July 11, 2022 09:46
chang the encoding of a file
package main
import (
"fmt"
"io/ioutil"
"os"
)
func checkBOM(filepath string) bool {
file, err := os.Open(filepath)
<!doctype html>
<html lang="en">
<head>
<title>Document</title>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/antd/4.17.0-alpha.3/antd.min.js" integrity="sha512-EvRn+ZDd7rBIodR8NJL+HrBvocKo2JIEkTURw3FFc2RdCDa68cqGDEgpCeE4fVM3SEeY06oO7T7xHxG/tb4hKw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/antd/4.17.0-alpha.3/antd.min.css" integrity="sha512-7FnaoVW3bqm5s1R5RRW/rUkIWBXv8HNRIAvLJiw90aiyAVn2Ma9T3D1TR4zSQAkV154ItnMT1Q/5i6jBWXKAbQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"runtime"
"github.com/go-vgo/robotgo"
@ficapy
ficapy / leetcode.go
Created April 22, 2021 08:30
open leetcode with the serial number
package main
import (
"fmt"
"os"
"os/exec"
"strconv"
"strings"
)
@ficapy
ficapy / analysis.py
Created April 12, 2021 05:23
jetbrains plugin development with Kotlin
# var a = new Array()
# document.querySelectorAll('.text-ellipsis').forEach(items=>{a.push(items.title)})
# console.log(a.join('\n'))
# git clone https://github.com/intellij-rust/intellij-rust --depth=1 || true
# ...
# ls -1 | xargs -I{} scc -f json {} | jq '.[] | select(.Name == "Kotlin") | .Code' | pbcopy
# ls -1 | pbcopy