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: utf-8 -*- | |
# China Jiliang University fashmash | |
import urllib2 | |
import webbrowser | |
import os | |
import time | |
opener = urllib2.build_opener() |
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
//CHECK FOR IE6 | |
function is_ie6(){ | |
return ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined)); | |
} |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HTML5 Drag and Drop</title> | |
<style> | |
body { | |
background-color: #515151; | |
width: 100%; | |
height: 100%; |
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
//自调用构造函数 | |
function Waffle() { | |
if (!(this instanceof Waffle)) { | |
return new Waffle(); | |
} | |
this.tastes = "yummy"; | |
} | |
var first = new Waffle(), | |
second = Waffle(); |
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
if (typeof Array.isArray === "undefined") { | |
Array.isArray = function(arg) { | |
return Object.prototype.toString.call(arg) === "[object Array]"; | |
} | |
} |
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
function genericErrorHandler() { | |
console.log("hello"); | |
} | |
try { | |
throw { | |
name: "MyErrorType", | |
message: "oops", | |
extra: "This was rather embarrassing", | |
remeby: genericErrorHandler |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | |
<title>Document</title> | |
<style> | |
.brand_zone { | |
height: 25px; | |
} |
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
//slide icon created by HTML5 canvas | |
(function(){ | |
var canv = $(‘#slide_icon’)[0]; | |
//canv.style.width=”300px“; | |
//canv.style.height=“300px”; | |
var cont = canv.getContext(’2d’); | |
//border cont.beginPath(); | |
cont.moveTo(8,10); | |
cont.arc(8,18,8,Math.PI*3/2,Math.PI,true); |
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
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
class Joke | |
attr_reader :doc, :next, :res | |
def initialize(url, n) | |
@res = [] | |
while n > 0 |
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
var obj = { | |
username: [], | |
id: [] | |
}; | |
$('tr td .betait-tbtd .val-usr').each(function(index, item) { | |
var text = $(item).parents('.betait-tbtd').text(); | |
var arr = text.match(/ID\:(\d*)/m); | |
if (arr && arr.length >= 2) { | |
var id = arr[1]; | |
var username = item.innerText; |
OlderNewer