Skip to content

Instantly share code, notes, and snippets.

@Kingson
Kingson / Douban_movie_query.py
Last active June 16, 2020 07:42
豆瓣电影查询助手V3.0 #增加给新关注的用户自动返回“欢迎关注豆瓣电影,输入电影名称即可快速查询电影讯息哦!”信息的功能 #大力丰富注释和docstring信息,以帮助后来者能快速上手。
#! /usr/bin/env python
# coding=utf-8
__author__ = 'jszhou'
from bottle import *
import hashlib
import xml.etree.ElementTree as ET
import urllib2
# import requests
import json
@RyanKung
RyanKung / doubanfm.el
Last active December 14, 2015 10:39
A Simple DoubanFM Client for Emacs
;; Installation:
;; In .emacs add:
;; (require 'doubanfm)
(dolist (path-list (list "./lib/"
"./lib/http-emacs"
"./lib/emms-3.0"))
(add-to-list 'load-path
(expand-file-name path-list (file-name-directory load-file-name))))
@sebgoa
sebgoa / crawler.py
Last active October 6, 2023 13:25
A web crawler and graph builder
#!/usr/bin/env python
import subprocess
import urlparse
import urllib2
from urllib import urlencode
import socket
import Queue
import threading
import getopt
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 20, 2025 21:14
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@paulczar
paulczar / logstash-perf.md
Last active May 14, 2018 03:13
logstash performance deets

Logstash Performance Testing

Server Details

HP BL460

  • 48 Gb Memory
  • 2 x X5675 @ 3.07GHz
  • 2 x 10 gbps NIC
  • 2tb NetApp NFS volume for ES data
@ndarville
ndarville / business-models.md
Last active February 27, 2025 10:00
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@happypeter
happypeter / happycasts_sync.sh
Last active July 3, 2020 07:54
upload my assets to the server
#!/usr/bin/env bash
sync_dryrun()
{
echo
echo -e "\033[1m ...dryrun...\033[0m"
rsync -av --delete ~/happycasts/episodes/ peter@linode:~/media/assets/episodes/ --dry-run
echo -e "\033[1m ...dryrun...\033[0m"
echo
}
@mattbailey
mattbailey / netscan.sh
Created November 8, 2012 19:25
netscan.sh
ips=$(nmap -sP 192.168.1.0/24 2>/dev/null | grep 'scan report' | awk '{print $NF}' |sed 's/(//;s/)//')
for ip in $ips
do
mac=$(arp $ip | cut -f 4 -d' ')
ptr=$(dig -x $ip| grep PTR |tail -n 1|awk '{ print $NF}')
if [ $ptr == 'PTR' ]
then
ptr="none"
fi
@lepture
lepture / gevent-flask.py
Last active January 30, 2020 15:29
gevent with werkzeug reload and debug
def runserver(port=5000, profile_log=None):
"""Runs a development server."""
from gevent.wsgi import WSGIServer
from werkzeug.serving import run_with_reloader
from werkzeug.debug import DebuggedApplication
from werkzeug.contrib.profiler import ProfilerMiddleware
port = int(port)
if profile_log: