This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding:utf8 -*- | |
from django.utils import simplejson as json | |
from django.http import HttpResponse | |
def jsonify(*args, **kwargs): | |
if len(args) == 1: | |
content = json.dumps(args[0]) | |
else: | |
content = json.dumps(dict(*args, **kwargs)) | |
response = HttpResponse(content=content, mimetype="application/json") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@login_required(login_url='/admin/') | |
def ad_edit(request,id=None): | |
cities = City.objects.filter(status='1') | |
adzones = AdZone.objects.all() | |
channel_choices = Ad.get_channel_choices() | |
ad = get_object_or_none(Ad,pk=id) | |
is_edit = True if ad is not None else False | |
form = AdForm(instance=ad) | |
action = Log.ADDITION if ad is None else Log.CHANGE | |
if request.method == 'POST': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require net/url) | |
(require db) | |
(require (planet neil/html-parsing:3:0)) | |
(require (planet clements/sxml2:1)) | |
(define base-url "http://www.lagou.com/gongsi/interviewExperiences.html?companyId=") | |
(define range-start 3000) | |
(define range-end 5000) | |
(define name-partern "//a/@title/text()") ;name 名称 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel | |
mkdir ~/ffmpeg_sources | |
cd ~/ffmpeg_sources | |
git clone --depth 1 git://github.com/yasm/yasm.git | |
cd yasm | |
autoreconf -fiv | |
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" | |
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"hostname": "0-----findandbuydrugs.grams7enekj3fhxz.onion", | |
"uri": "http://0-----findandbuydrugs.grams7enekj3fhxz.onion/" | |
}, | |
{ | |
"hostname": "0-0helix.grams7enekj3fhxz.onion", | |
"uri": "http://0-0helix.grams7enekj3fhxz.onion/" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"update_time": "2017-02-17 19:27:56", "type": "program_ondemand", "duration": 1094, "id": 6536143, "desc": "", "name": "\u7b2c309\u671f\uff1a\u8f7b\u8f7b\u5730\u6211\u8d70\u4e86\uff0c\u6b63\u5982\u6211\u8f7b\u8f7b\u5730\u6765", "img_url": "", "channel_id": "143114", "playcount": "1.0\u4e07", "res_id": 6809669, "file_path": "m4a/58a6dda17cb8913976a560a0_6809669_64.m4a"}, {"update_time": "2017-02-13 18:04:05", "type": "program_ondemand", "duration": 1472, "id": 6505961, "desc": "", "name": "\u7b2c308\u671f\uff1a\u662f\u771f\u7684\uff0c\u4e2d\u4fc4\u5408\u4f5c\u91cd\u578b\u76f4\u5347\u673a", "img_url": "", "channel_id": "143114", "playcount": "18.9\u4e07", "res_id": 6788314, "file_path": "m4a/58a183a97cb8913976a534d0_6788314_64.m4a"}, {"update_time": "2017-02-11 20:19:38", "type": "program_ondemand", "duration": 3731, "id": 6496588, "desc": "", "name": "\u519b\u8ff7\u517b\u6210\u4e4b\u6a21\u578b\u7bc7", "img_url": "", "channel_id": "143114", "playcount": "19.5\u4e07", "res_id": 6780354, "file_path": "m4a/589ef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
walk_dir = sys.argv[1] | |
print('walk_dir = ' + walk_dir) | |
# If your current working directory may change during script execution, it's recommended to | |
# immediately convert program arguments to an absolute path. Then the variable root below will | |
# be an absolute path as well. Example: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
os.walk('.') |