Skip to content

Instantly share code, notes, and snippets.

// Author: ChatGPT
#include <iostream>
#include <memory>
#include <string>
#include <thread>
#include <grpcpp/grpcpp.h>
#include "example.grpc.pb.h"
using grpc::Channel;
import taichi as ti
ti.init(arch=ti.gpu)
n = 320
pixels = ti.field(dtype=float, shape=(n * 2, n))
@ti.func
def complex_sqr(z):
return ti.Vector([z[0]**2 - z[1]**2, z[1] * z[0] * 2])
@mougua
mougua / archive_your_unread_pocket_list.js
Created July 1, 2021 02:05
archive your unread pocket list
for (let n = 0; n < 1000000; n ++){
for (let i of document.getElementsByClassName("detail bulkEdit")){i.click();};
document.getElementsByClassName("b1vi9mhm t1221eea pzhe358")[2].click();
document.getElementsByClassName("b1344aws primary")[0].click();
await new Promise(r => setTimeout(r, 5000));
}
// copy and codes above and run them in your browser console
@mougua
mougua / tweetdeck_stylish.css
Created March 9, 2018 02:31
自用的tweetdeck stylish
* {
font-family: Hiragino Sans GB !important;
letter-spacing: 0.6px;
}
.txt-small {
font-family: 微软雅黑 !important;
font-size: 12px !important;
}
$template = 'abc{def}gh{ijk}lmn';
$data['def']='DEF你妹';
$data['ijk']='IJK壕';
preg_match_all('/(?<=\{)([^\}]*?)(?=\})/' , $template , $arr);
foreach ($arr[0] as &$item) {
$template= str_replace('{' . $item . '}', $data[$item], $template);
}
echo $template;
@mougua
mougua / designer.html
Created July 30, 2014 03:25
designer
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;