Skip to content

Instantly share code, notes, and snippets.

View lloydzhou's full-sized avatar
:octocat:
Focusing

Lloyd Zhou lloydzhou

:octocat:
Focusing
View GitHub Profile
@bmaupin
bmaupin / tiling-extensions-for-gnome.md
Last active June 15, 2024 08:58
Tiling extensions for Gnome

Goal: find a Linux alternative to FancyZones for Windows

Name Recommended Type Supports main colum Supports layouts Multiple windows in same tile Windows can span multiple zones Notes
gSnap 👍👍 Gnome extension yes yes yes yes Can be configured almost just like FancyZones; in the settings:
  • disable Show tabs
  • enable Hold CTRL to snap windows
gTile Gnome extension no?
Tiling Assistant 👍 Gnome extension yes yes yes yes Layout support is "experimental" and the UX is a bit unintuitive; after enabling layouts, you have to click the star icon beside a layout to mark it as a favourite before you can then hold Alt while dragging
import openai
import pinecone
from sentence_transformers import SentenceTransformer
class GPTConversationManager:
def __init__(self, api_key, pinecone_api_key, index_name):
self.api_key = api_key
openai.api_key = self.api_key
self.conversation_history = []
self.pinecone_api_key = pinecone_api_key
@diyism
diyism / x11docker (linux sanbox like android shelter app)
Last active June 6, 2024 13:18
x11docker (linux sanbox like android shelter app)
"现在有很多国产linux程序了,比如 钉钉/飞书,
则linux上也有了隔离国产程序的需求,
试了1.virtualbox, 2.firejail, 3.docker theasp/novnc,
都不够方便实用, 最好用启动单个程序最快的是x11docker
@_:10个我离不开的android应用:
1.Shelter(隔离国产应用)"
#https://github.com/mviereck/x11docker
curl -fsSL https://raw.githubusercontent.com/mviereck/x11docker/master/x11docker | sudo bash -s -- --update
#!/usr/bin/python3
import sys
import asyncio
import greenlet
class AsyncIoGreenlet(greenlet.greenlet):
def __init__(self, driver, fn):
greenlet.greenlet.__init__(self, fn, driver)
self.driver = driver
export const h=(t,p,...c)=>({t,p,c,k:p&&p.key})
export const render=(e,d,t=d.t||(d.t={}),p,r,c,m,y)=>
// arrays
e.map?e.map((e,p)=>render(e,d,t.o&&t.o[p])):
// components
e.t.call?(e.i=render((render.c=e).t(Object.assign({children:e.c},e.p),e.s=t.s||{},t=>
render(Object.assign(e.s,t)&&e,d,e)),t.i||d,t&&t.i||{}),d.t=t=e):(
// create notes
m=t.d||(e.t?document.createElement(e.t):new Text(e.p)),
// diff props
@dexbol
dexbol / crude-immer.js
Last active February 14, 2023 05:01
immer.js 实现方式简介
#!/usr/bin/env node
/**
* 此函数只为说明 immer.js 的基本实现方式(基于 ES6 Proxy 非 ES5),因此尽量保持简陋,
* 并且只支持普通对象,而且不能通过返回值的方式生成新对象,
* 也不能增加新属性。
* 同时,也不支持 Array Map Set 等其他数据类型。
*/
// 存储 revoke 函数,用于释放 Proxy 对象资源。
@hermanbanken
hermanbanken / Dockerfile
Last active June 9, 2024 22:18
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@baymaxium
baymaxium / content.md
Created October 18, 2017 09:00
生产环境中使用Docker Swarm的一些建议

原文:Docker

如果你在单个生产节点上用过Docker,然后发现单个节点的资源不够用,那么你会怎么做呢?我也遇到过这种情况! 关于在生产环境中使用Docker Swarm,我会为你提供一些建议,也许能够帮到你。这些都是我一年来积累的一些经验。

另外,如果你对Docker Swam不熟悉的话,可以参考我之前的博客My experience with Docker Swarm - when you may need it?(http://suo.im/1m7qW8)

1. 阅读官方文档

@ckeyer
ckeyer / 书籍.md
Created January 20, 2017 01:18
经典编程书籍大全

经典编程书籍大全

100+ 经典技术书籍,涵盖:计算机系统与网络、系统架构、算法与数据结构、前端开发、后端开发、移动开发、数据库、测试、项目与团队、程序员职业修炼、求职面试 和 编程相关的经典书籍。

这个列表综合了伯乐在线网站以往推荐经典书籍文章中的列表,以及在微信和微博中被广泛推荐的好书。虽然已经包括了100多本,覆盖的面也比较全。仍然有很多方面需要补充,而且相信还有很多没有被收录的好书。欢迎大家在 issues 中推荐或自荐。

计算机系统与网络

@kevinronan
kevinronan / numpy2double**.md
Last active January 12, 2023 06:43
Call a function with a double** in Cython, Pybind11, and CFFI from numpy

Cython

populate_.h

#ifndef PROGRAM_HEADER
#define PROGRAM_HEADER

void populate(double ** arr, int len_x, int len_y);