| Instance | Branch |
|---|
This file contains hidden or 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| this_dir = File.dirname(__FILE__) + "/" | |
| require this_dir + "vagrant/hostmaster.rb" | |
| Vagrant::Config.run do |config| | |
| # define some colors for our output | |
| def colorize(text, color_code) "#{color_code}#{text}\033[0m" end |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| set -e | |
| if [ -z "$iso" ] ; then | |
| printf -- ">>> You must invoke with iso=/path/to/winxp.iso $(basename $0)\n" | |
| exit 1 | |
| fi | |
| if [ -z "$url" ] ; then |
This file contains hidden or 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
| #!/usr/bin/env python | |
| ## Tiny Syslog Server in Python. | |
| ## | |
| ## This is a tiny syslog server that is able to receive UDP based syslog | |
| ## entries on a specified port and save them to a file. | |
| ## That's it... it does nothing else... | |
| ## There are a few configuration parameters. | |
| LOG_FILE = 'youlogfile.log' |
This file contains hidden or 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
| local path = ngx.var.request:split(" ")[2] -- path | |
| local t={} | |
| local cjson = require "cjson" | |
| local m = ngx.re.match(path,[=[^/sentence/(.+)]=]) | |
| local words = m[1]:split("%%20") -- words in the sentence | |
| for i,k in pairs(words) do | |
| local res_word = ngx.location.capture("/real/".. k ) | |
| local value=cjson.new().decode(res_word.body) | |
| table.insert(t, value.sentiment) |
This file contains hidden or 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 java.util.ArrayList; | |
| import java.util.Date; | |
| import java.util.List; | |
| import java.util.Map; | |
| import org.acra.ACRA; | |
| import org.acra.collector.CrashReportData; | |
| import org.acra.ReportField; | |
| import org.acra.sender.ReportSender; |
This file contains hidden or 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
| #!flask/bin/python | |
| from flask import Flask, jsonify, abort, request, make_response, url_for | |
| from flask_httpauth import HTTPBasicAuth | |
| app = Flask(__name__, static_url_path = "") | |
| auth = HTTPBasicAuth() | |
| @auth.get_password | |
| def get_password(username): | |
| if username == 'miguel': |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import requests | |
| import re | |
| from bs4 import BeautifulSoup | |
| from subprocess import call, check_output | |
| import string | |
| def fetch_html(links): |
This file contains hidden or 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 zlib | |
| import struct | |
| import sys | |
| pvr = sys.argv[1] | |
| ccz = pvr + ".ccz" | |
| pvr = open(pvr).read() | |
| ccz = open(ccz, "wb") |
This file contains hidden or 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: utf-8 -*- | |
| from bs4 import BeautifulSoup | |
| import requests | |
| username = '' ###账号### | |
| password = '' ###密码### | |
| login_url = 'http://v2ex.com/signin' ###如V2EX设置了使用 SSL,必须改 https### | |
| index_url = 'http://v2ex.com' ###同上### | |
| mission_url = 'http://www.v2ex.com/mission/daily' ###同上### | |
| UA = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) \ |