Skip to content

Instantly share code, notes, and snippets.

@ninehills
ninehills / chatpdf-zh.ipynb
Last active April 9, 2024 06:40
ChatPDF-zh.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@trsqxyz
trsqxyz / gist:9223336
Created February 26, 2014 04:08
x-o-referee
def checkio(gr):
r = gr
r += ["".join(v) for v in zip(*gr)]
r += [gr[0][0] + gr[1][1] + gr[2][2],
gr[0][2] + gr[1][1] + gr[2][0]]
o = r.count("OOO")
x = r.count("XXX")
if o and x:
@cloudsben
cloudsben / md-menu.html
Last active June 14, 2023 07:46
markdown menu
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.2/styles/googlecode.min.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://yandex.st/highlightjs/6.2/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
$(document).ready(function(){
$("h2,h3,h4,h5,h6").each(function(i,item){
var tag = $(item).get(0).localName;
@preshing
preshing / list_modifications.py
Last active January 21, 2016 04:44
List the contents of folders recursively, sorted by modification time.
#! /usr/bin/env python
# License: http://creativecommons.org/publicdomain/zero/1.0/
# See http://preshing.com/20130115/view-your-filesystem-history-using-python
import optparse
import os
import fnmatch
import time
# Parse options
parser = optparse.OptionParser(usage='Usage: %prog [options] path [path2 ...]')
@pklaus
pklaus / ping.py
Created March 5, 2011 09:50
A pure python ping implementation using raw socket.
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping