Skip to content

Instantly share code, notes, and snippets.

View chenkovsky's full-sized avatar

Chongchen Chen chenkovsky

  • Fudan
  • Shanghai
View GitHub Profile
import {Controller} from '@hotwired/stimulus'
import {Editor} from "@tiptap/core"
import {Mention} from "@tiptap/extension-mention";
import StarterKit from "@tiptap/starter-kit"
export default class extends Controller {
static targets = ['input', 'suggestions']
connect() {
this.editor = new Editor({
@snrbrnjna
snrbrnjna / .htaccess
Last active May 10, 2022 01:56
Jekyll Auth Plugin - to manage http basic auth for jekyll generated pages and directories
#### Jekyll Layout: /_layouts/.htaccess
# Apache Configuration File
{% if ((page.auth_dir.users != empty) or (page.auth_dir.groups != empty)) %}
AuthName "Privater Bereich"
AuthType Basic
# => mehrere Require Blocks werden geodert: http://d43.me/blog/1157
AuthzUserAuthoritative Off
AuthUserFile {{ page.auth_remote_user_file }}
crack Sublime Text (2 and 3)
1. Open Sublime in a HEX editor (the executable file)
2. Find 43 33 33 42 30 32
3. Replace in the string 33 42 with 32 42
4. Save
5. Enter the license below:
—–BEGIN LICENSE—–
Patrick Carey
@mblondel
mblondel / kernel_kmeans.py
Last active January 4, 2024 11:45
Kernel K-means.
"""Kernel K-means"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils import check_random_state
@hideaki-t
hideaki-t / gist:1614517
Created January 15, 2012 05:39
testing japanese text in networkx
# coding: utf-8
import networkx
G=networkx.Graph()
from matplotlib import pyplot
G.add_edge(u'池袋', u'新宿')
G.add_edge(u'新宿', u'代々木')
G.add_edge(u'代々木', u'品川')
G.add_edge(u'品川', u'東京')
G.add_edge(u'東京', u'神田')