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
# encoding=utf8 | |
import urllib2 | |
from bs4 import BeautifulSoup | |
url = 'http://www.wandoujia.com/top' | |
opener = urllib2.build_opener() | |
content = opener.open(url).read() |
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
<Context docBase="/usr/share/tomcat6/webapps/solr.war" debug="0" crossContext="true" > | |
<Environment name="solr/home" type="java.lang.String" value="/root/solr" override="true" /> | |
</Context> |
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
'use strict'; | |
var _ = function(obj) { | |
console.log('heading'); | |
if (obj instanceof _) return obj; | |
console.log('body'); | |
if (!(this instanceof _)) return new _(obj); |
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
// ==UserScript== | |
// @match http://500px.com/photo/* | |
// ==/Userscript== | |
'use strict'; | |
(function(){ | |
var imgPlaceHolder = document.querySelector('.nude_placeholder'); | |
var imgUrl = imgPlaceHolder.nextSibling.src; |
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
var url = 'http://ued.campus.alibaba.com/quiz3/index.php?t=OTEyNzQ1MjRMY3ZEdktWd1ZSRGxZQlZWUUFVazhH'; | |
var msg = []; | |
var start = 10; | |
function get(room) { | |
$.get(url + '&room=' + room, function(response){ | |
var t = null; | |
msg.push($(response).find('#message').html()); | |
t = $(response).find('#next-room').html(); |
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
<?php | |
function datesBetween($start, $end, $format = 'Ymd') | |
{ | |
$output = array(); | |
$startDate = date($format, strtotime($start)); | |
$endDate = date($format, strtotime($end)); | |
$output[] = $startDate; |
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
var list = ['test', 'for', 'var', 'in', 'for', 'block']; | |
for(var i = 0, l = list.length; i < l; i++) { | |
var forBlockVal = i; | |
} | |
console.log(i); | |
console.log(forBlockVal); |
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
'use strict'; | |
var start = new Date(2013, 0, 1); | |
var end = new Date(2014, 0, 1); | |
var data = []; | |
while (start < end) { | |
data.push( [start.getTime() / 1000, Math.floor( Math.random() * 6) ] ); | |
start = new Date(start.setDate( |
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
<?php | |
$ua = $_SERVER['HTTP_USER_AGENT']; | |
$name = "+ 孙_燕-姿 &✺☞& 繁體字&2013.doc"; | |
header('Content-Type: application/octet-stream'); | |
if (preg_match("/MSIE/", $ua)) { | |
header('Content-Disposition: attachment; filename="' . rawurlencode($name) . '"'); |
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
$(function(){ | |
'use strict'; | |
var App = { | |
init: function() { | |
this.cacheElements(); | |
this.bindEvents(); | |
}, | |
cacheElements: function() { |
NewerOlder