Skip to content

Instantly share code, notes, and snippets.

View fxxkscript's full-sized avatar
🎯
Focusing

Ray fxxkscript

🎯
Focusing
View GitHub Profile
@fxxkscript
fxxkscript / cjlu_facemash.py
Created July 24, 2012 13:54
China Jiliang University fashmash
# -*- coding: utf-8 -*-
# China Jiliang University fashmash
import urllib2
import webbrowser
import os
import time
opener = urllib2.build_opener()
@fxxkscript
fxxkscript / is_ie6.js
Created September 5, 2012 10:08
判断IE6
//CHECK FOR IE6
function is_ie6(){
return ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined));
}
@fxxkscript
fxxkscript / drag.html
Created November 7, 2012 14:38
HTML5 Drag and Drop
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>HTML5 Drag and Drop</title>
<style>
body {
background-color: #515151;
width: 100%;
height: 100%;
@fxxkscript
fxxkscript / constructor.js
Created December 19, 2012 02:29
自调用构造函数
//自调用构造函数
function Waffle() {
if (!(this instanceof Waffle)) {
return new Waffle();
}
this.tastes = "yummy";
}
var first = new Waffle(),
second = Waffle();
@fxxkscript
fxxkscript / isArray.js
Created December 19, 2012 02:40
判断数组类型
if (typeof Array.isArray === "undefined") {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === "[object Array]";
}
}
@fxxkscript
fxxkscript / error.js
Created December 19, 2012 02:55
错误对象
function genericErrorHandler() {
console.log("hello");
}
try {
throw {
name: "MyErrorType",
message: "oops",
extra: "This was rather embarrassing",
remeby: genericErrorHandler
@fxxkscript
fxxkscript / brand.html
Created December 19, 2012 04:45
手机品牌专区
<!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;
}
//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);
#!/usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
class Joke
attr_reader :doc, :next, :res
def initialize(url, n)
@res = []
while n > 0
@fxxkscript
fxxkscript / wx_avatar.js
Last active December 18, 2015 13:09
微信头像
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;