Skip to content

Instantly share code, notes, and snippets.

@gaotongfei
gaotongfei / request_with_proxy.py
Last active August 9, 2016 17:34
request with proxy
#coding:utf-8
import requests
import time
from fake_useragent import UserAgent
import requests
requests.packages.urllib3.disable_warnings()
from random import randint
import socks
import socket
@gaotongfei
gaotongfei / useragent.txt
Created August 10, 2016 18:05
useragent
Mozilla/5.0 (Amiga; U; AmigaOS 1.3; en; rv:1.8.1.19) Gecko/20081204 SeaMonkey/1.1.14
Mozilla/5.0 (AmigaOS; U; AmigaOS 1.3; en-US; rv:1.8.1.21) Gecko/20090303 SeaMonkey/1.1.15
Mozilla/5.0 (AmigaOS; U; AmigaOS 1.3; en; rv:1.8.1.19) Gecko/20081204 SeaMonkey/1.1.14
Mozilla/5.0 (Android 2.2; Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
Mozilla/5.0 (BeOS; U; BeOS BeBox; fr; rv:1.9) Gecko/2008052906 BonEcho/2.0
Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.1) Gecko/20061220 BonEcho/2.0.0.1
Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.10) Gecko/20071128 BonEcho/2.0.0.10
Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.17) Gecko/20080831 BonEcho/2.0.0.17
Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.6) Gecko/20070731 BonEcho/2.0.0.6
Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.7) Gecko/20070917 BonEcho/2.0.0.7
@gaotongfei
gaotongfei / file1.txt
Created August 13, 2016 13:28
the description for this gist
String file contents
http://advanced-python.readthedocs.io/en/latest/rest/authtoken.html
import string
s = "Miljkovi´c, K¨all"
printable = set(string.printable)
print(filter(lambda x: x in printable, s))
<!--more-->
结果:
https://github.com/rails/jbuilder/issues/250
@gaotongfei
gaotongfei / feed
Created June 11, 2017 11:53
railscast rss feed
title = "RailsCasts"
author = "Ryan Bates"
description = "Every week you will be treated to a new RailsCasts episode featuring tips and tricks with Ruby on Rails, the popular web development framework. These screencasts are short and focus on one technique so you can quickly move on to applying it to your own project. The topics are geared toward the intermediate Rails developer, but beginners and experts will get something out of it as well."
keywords = "rails, ruby on rails, screencasts, podcasts, tips, tricks, tutorials, training, programming, railscast"
if params[:ipod]
title += " (Mobile)"
description += " This version is for mobile devices which cannot support the full resolution version."
keywords += ', mobile'
image = "http://railscasts.com/images/ipod_railscasts_cover.jpg"
@gaotongfei
gaotongfei / Rakefile
Created August 18, 2017 09:05 — forked from schickling/Rakefile
Activerecord without Rails
require "active_record"
namespace :db do
db_config = YAML::load(File.open('config/database.yml'))
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'})
desc "Create the database"
task :create do
ActiveRecord::Base.establish_connection(db_config_admin)