Skip to content

Instantly share code, notes, and snippets.

@codesaler
codesaler / 12factor.md
Created August 23, 2012 23:25 — forked from harmy/12factor.md
12factor

中文翻译:梁山 英文原文:Adam Wiggins

简介

如今,软件通常会作为一种服务来交付,它们被称为网络应用程序,或“软件即服务”(SaaS)。“十二要素应用程序”(12-Factor App)为构建如下的SaaS应用提供了方法论:

  • 使用标准化流程自动配置,从而使新的开发者花费最少的学习成本加入这个项目;
  • 和操作系统之间尽可能的划清界限,在各个系统中提供最大的可移植性
  • 适合部署在现代的云计算平台,从而在服务器和系统管理方面节省资源;
@codesaler
codesaler / crawl.py
Created October 14, 2012 13:55 — forked from jonhurlock/crawl.py
Python Web Crawler - jonhurlock
#!/usr/bin/env python
"""
Simple Indexer
=================================
Author: Jon Hurlock, October 2011
This script basically crawls a domain (not just a page) and
then extracts all links <a href=""></a>, and finds all links
on that domain it also is able extract different file types
@codesaler
codesaler / crawl.py
Created October 14, 2012 14:07 — forked from 0xh3x/crawl.py
#!/usr/bin/env python
import re
import urllib2
from BeautifulSoup import BeautifulSoup
class Crawler(object):
def __init__(self):
self.job_list = []
<?php
if (isset($_GET['url'])) {
$url = rawurldecode(trim($_GET['url']));
if (empty($url))
return;
if (substr($url, 0, 4) != 'http')
$url = "http://{$url}";
require_once 'PHPWebDriver/__init__.php';
#!/bin/bash
# clear rule
iptables -F
iptables -X
iptables -Z
# default policy
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
@codesaler
codesaler / unsplash.py
Last active August 29, 2015 14:06 — forked from ccbikai/unsplash.py
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
# unsplash 全站下载脚本
# 请先安装 requests ,BeautifulSoup
# pip install requests beautifulsoup4
# 运行 python unsplash.py
# 输入最小页数和最大页数