Skip to content

Instantly share code, notes, and snippets.

View TheWaWaR's full-sized avatar
🌀
Focusing

LingFeng TheWaWaR

🌀
Focusing
View GitHub Profile
@rve
rve / gist:5652087
Last active December 25, 2017 08:42
纪念p神
p神注销了!从此对我来说豆瓣就是一个没有男神的地方的。现在我能做的,就是让p神的神迹在新注册的友邻中流传“从前豆瓣上有一个p神,他读过了cs领域每一本书,当然,他很不喜欢(formal) semantics ...
p神真正地神格化了,它已经与CS类书评数据合为一体,融入了推荐系统的AI里,活在了每一次豆瓣猜中。而我永远怀念的,却是他那品味算不高的AV番号……
许多年之后,面对豆瓣猜,X君准会想起那个P神注销的遥远的上午。
想起评论区曾经一度被p神所支配的恐怖,还有被囚禁于p神阅读面里的那份屈辱 -
@danielholmstrom
danielholmstrom / crash_syslog.py
Created January 31, 2013 18:09
Crash syslog.syslog() in python by logging an empty zip-file.
"""How to crash syslog.syslog
File: crash_syslog.py
Running this will product this output:
Traceback (most recent call last):
File "./crash_syslog.py", line 12, in <module>
syslog(LOG_INFO, base64.b64decode(b64))
TypeError: [priority,] message string
@ralph-tice
ralph-tice / gist:4252866
Last active October 13, 2015 20:38
swapping out OpenJDK for Oracle JDK on Amazon EC2
#download the JDK
#oracle's rpm.bin gets pulled down as corrupt..zzz
#wget --no-cookies --header "Cookie: gpw_e24=xxx" "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64-rpm.bin" -O jdk-7-linux-x64-rpm.bin
#updated for version 7u11
wget --no-cookies --header "Cookie: gpw_e24=xxx" http://download.oracle.com/otn-pub/java/jdk/7u11-b21/jdk-7u11-linux-x64.rpm -O jdk-7u11-linux-x64.rpm
sudo rpm -ivh jdk-7u11-linux-x64.rpm
sudo alternatives --install /usr/bin/java java /usr/java/default/bin/java 20000
@elpuri
elpuri / gist:3753756
Created September 20, 2012 03:12
A collapsible nested list example in QML
import QtQuick 1.1
Item {
width: 200
height: 300
ListView {
anchors.fill: parent
model: nestedModel
delegate: categoryDelegate
@danaspiegel
danaspiegel / gist:3105761
Created July 13, 2012 16:19
Git pre-commit hook to check pep8 and pyflakes
#!/usr/bin/python
# borrowed from https://github.com/lbolla/dotfiles/blob/master/githooks/pre-commit
import os
import sys
import re
import subprocess
@lrvick
lrvick / flask_geventwebsocket_example.py
Created September 1, 2011 07:17
Simple Websocket echo client/server with Flask and gevent / gevent-websocket
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@knowtheory
knowtheory / sql.citrus
Created May 20, 2011 16:24
A Parsing Expression Grammar for parsing an SQL subset. Written as a start to parsing SQL and generating Veritas relations (see: https://github.com/dkubb/veritas )
grammar SQL
rule statement
select_statement <Veritas::SQL::Select>
| set_operation_statement <Veritas::SQL::SetOperation>
| "(" [\s]* statement [\s]* ")"
end
rule set_operation_statement
"(" [\s]* left:select_statement <Veritas::SQL::Select> [\s]* ")"
[\s]* set_operator ([\s]+ distinct:`DISTINCT`)? [\s]*