Skip to content

Instantly share code, notes, and snippets.

View ccbikai's full-sized avatar
🍜
吃面条

面条 ccbikai

🍜
吃面条
View GitHub Profile
(function ($) {
var layers = [],
docWidth = $(window).width(),
docHeight = $(window).height(),
urlString = ' | ',
plaxObjects = {
'layerA': {
'start':3,
'range':50,
@ccbikai
ccbikai / base.js
Last active December 18, 2015 15:09
背景图片切换核心代码
/*! Backstretch - v2.0.3 - 2012-11-30
* http://srobbin.com/jquery-plugins/backstretch/
* Copyright (c) 2012 Scott Robbin; Licensed MIT */
(function(e,t,n){"use strict";e.fn.backstretch=function(r,s){return(r===n||r.length===0)&&e.error("No images were supplied for Backstretch"),e(t).scrollTop()===0&&t.scrollTo(0,0),this.each(function(){var t=e(this),n=t.data("backstretch");n&&(s=e.extend(n.options,s),n.destroy(!0)),n=new i(this,r,s),t.data("backstretch",n)})},e.backstretch=function(t,n){return e("body").backstretch(t,n).data("backstretch")},e.expr[":"].backstretch=function(t){return e(t).data("backstretch")!==n},e.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5e3,fade:0};var r={wrap:{left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},img:{position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxWidth:"none",zIndex:-999999}},i=function(n,i,o){this.options=e.extend({},e.fn.backstretch.defaults,o||{}),this.images=e.i
@ccbikai
ccbikai / bjqh.js
Created June 18, 2013 03:24
背景图片切换
var base="http://winysky.com/usr/themes/NewPath/";
var core = document.createElement('script');
core.type = 'text/javascript'; core.async = true;
core.src = 'https://gist.github.com/ccbikai/5802471/raw/42ad24c950425b2f7d2ee258629258976518e3a9/base.js';
var s = document.getElementsByTagName('head')[0];
s.appendChild(core);
var bgimg = [
"http://pic.winysky.com/content/uploads/bg/0.jpg",
"http://pic.winysky.com/content/uploads/bg/1.jpg",
"http://pic.winysky.com/content/uploads/bg/2.jpg",
@ccbikai
ccbikai / aria2.conf
Created July 19, 2013 07:22
aria2配置文件
#允许rpc
enable-rpc=true
#允许所有来源, web界面跨域权限需要
rpc-allow-origin-all=true
#允许非外部访问
rpc-listen-all=true
#RPC端口, 仅当默认端口被占用时修改
rpc-listen-port=6800
# 保存日志到文件,没有该文件用 touch 命令新建,不然会报错
log=/mnt/upan/aria2.log
@ccbikai
ccbikai / dnsupdate.php
Created July 19, 2013 07:29
ddns dnspod 更新脚本
<?php
error_reporting(0);
set_time_limit(0);
header('Content-type:text/html; charset=utf-8');
if(!$_GET['username']||!$_GET['password']||!$_GET['domain']){
exit(json_encode(array('msg'=>'username,password,domain 参数必选')));
}
$domain = explode("@", $_GET['domain']);
@ccbikai
ccbikai / rename.py
Created November 7, 2013 15:09
python批量修改文件名后缀
import os
def change_suffix(dir_path):
for name in os.listdir(dir_path):
new_name=name.replace('.markdown','.md')
os.rename(name,new_name)
change_suffix(".")
@ccbikai
ccbikai / nginx301.conf
Created November 8, 2013 12:17
nginx 泛域名301转发 核心代码
if ($host ~* ^(.*)\.nju\.pt\/^(*)) {
set $sub_name $1;
set $path $2;
rewrite ^(.*) http://$sub_name.njupt.edu.cn$path permanent;
}
@ccbikai
ccbikai / duoshuo.py
Created January 31, 2014 02:00
提取多说备份评论者邮箱
import simplejson
file_object = open('./export.json')
try:
all_the_text = file_object.read()
finally:
file_object.close()
emails=simplejson.loads(all_the_text)
old_emails = emails.values()[1]
mails = []
for dict in old_emails:
@ccbikai
ccbikai / xiami.py
Created April 3, 2014 10:59
利用SAE获得虾米音乐外链
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import os
import sae
import web
import json
import urllib2
urls=('/','Index','/xiami/(.+)','Xiami')
@ccbikai
ccbikai / push.php
Created April 16, 2014 14:06
利用pushbullent推送wordpress评论
function pushbullet($title,$body)
{
$apikey='v1dFWupd5ifoOz0tajOc';
$device_iden='ujEH7v8iCkedjz';
$req_args = array(
'headers' => array(
'Authorization' => 'Basic ' . base64_encode( $apikey.':')
),
'timeout' => 50,
'sslverify' =>FALSE,