Skip to content

Instantly share code, notes, and snippets.

@jiangjianxiao
jiangjianxiao / pythondoneright.md
Created June 19, 2023 21:54 — forked from MuhsinFatih/fix-macos-python.md
How to recover from messed up python installation on mac, and never have to mess with apple's shitty python confusion factory

I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.

What the hell?

Here is what I had messed up, which you also probably did:

  • I had too many different python interpreters
  • Too many different symlinks which I lost track of
  • almost no package I installed with pip worked without a headache
  • any attempt to fix using online resources made it worse.
@jiangjianxiao
jiangjianxiao / groovy-pom.xml
Created April 4, 2020 06:29 — forked from sparsick/groovy-pom.xml
Maven POM Template for Groovy Projects
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.group.id</groupId>
<artifactId>my.artifact.id</artifactId>
<version>1.0.0-SNAPSHOT</version>
@jiangjianxiao
jiangjianxiao / gist:775dbd0c1a3c1a636eb0
Last active August 29, 2015 14:19
c8 2015-4-23日变更
ALTER TABLE workspaces ADD COLUMN form_executed1_user character varying(50);
ALTER TABLE workspaces ADD COLUMN form_executed1_at timestamp without time zone;
CREATE INDEX ix_workspaces_form_executed1_user
ON workspaces
USING btree
(form_executed1_user COLLATE pg_catalog."default");
DROP INDEX idx_workspaces_category_rank_form_created_at;
-- 这个改进未完成性能160毫秒
// debugger;
var closable = true;
var id = 'tab_test';
// var t = tabs.getComponent(id);
// if (t) {
// tabs.setActiveTab(t, closable);
// } else{
// main();
from time import sleep
import tornado
from multiprocessing.pool import ThreadPool
_workers = ThreadPool(10)
class BackgroundMix(tornado.web.RequestHandler):
"""将block任务放入线程池中执行
EXAMPLE:
# blocking task like querying to MySQL