Skip to content

Instantly share code, notes, and snippets.

View creamidea's full-sized avatar

NekoTrek creamidea

View GitHub Profile
@creamidea
creamidea / xiamitask.py
Created May 26, 2014 04:26
虾米签到
# -*- coding: utf-8 -*-
import os
import sys
import re
import json
import urllib
import urllib2
import cookielib
import getpass
from threading import Timer
@creamidea
creamidea / reijieweb.py
Last active August 29, 2015 14:01
login ruijie
# -*- coding: utf-8 -*-
import re
import urllib
import urllib2
import cookielib
import time
import getpass
import threading
from HTMLParser import HTMLParser
@creamidea
creamidea / loginpe.py
Created May 2, 2014 14:58
基于django的体育刷卡次数抓取展示程序主题
# -*- coding: utf-8 -*-
# Create your views here.
from __future__ import division #加载这个之后,除法就不是地板除了。
import re
import urllib
import urllib2
import cookielib
from datetime import datetime, date
@creamidea
creamidea / apache2-mushroom.conf
Last active August 29, 2015 14:00
mushroom-configure-file
# ########################################################################
# mushroom website
# 写完这个之后不要忘记 sudo a2ensite 来激活
WSGIPythonPath /home/icecream/NodeSite:/home/icecream/mushroom/lib/python2.7/sit
e-packages
# WSGIDaemonProcess site-1 processes=2 threads=25 display-name=%{GROUP}
# WSGIProcessGroup site-1
<VirtualHost *:8080>
ServerName 127.0.0.1
ServerAlias site-1
# Rollcode.com
import commands
import os
import RPi.GPIO as GPIO
import time
LCD_RS = 25
LCD_E = 24
LCD_D4 = 23
LCD_D5 = 17
### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set cd4b8d8b-3265-4fa6-b8a6-9b3b74d9f849
insmod png
if background_image /share/images/desktop-base/spacefun-grub.png; then
set color_normal=light-gray/black
set color_highlight=white/black
else
;; in powerline.el
(defface powerline-active1 '((t (:foreground "#030303" :background "#69b4ff" :inherit mode-line)))
"Powerline face 1."
:group 'powerline)
(defface powerline-active2 '((t (:foreground "#030303" :background "#ff6969" :inherit mode-line)))
"Powerline face 2."
:group 'powerline)
(defface powerline-inactive1
@creamidea
creamidea / verilog-mode-config.el
Created January 12, 2014 08:05
emace verilog-mode in windows7 configure
;; ===================================================
;; For verilog mode
(add-to-list 'load-path "~/.emacs.d/lisp/verilog-mode.el")
(require 'verilog-mode)
(add-to-list 'auto-mode-alist '("\\.vl$" . verilog-mode))
(defun prepend-path ( my-path )
(setq load-path (cons (expand-file-name my-path) load-path)))
(defun append-path ( my-path )
(setq load-path (append load-path (list (expand-file-name my-path)))))
;; Look first in the directory ~/elisp for elisp files
@creamidea
creamidea / lru.js
Last active January 2, 2016 22:39
LUR javascript 实现。浏览器一种缓存机制 AJAX HACKS P.390
var cache = new Array;
var top_key = null; // 用于指向头部
var prev_key = null; //用于指向最后一个元素
var curr_cache_size = 0; //用于计数现在的缓存大小
var MAX_CACHE_SIZE;
function show_cache_info(answer_form) {
var divCache = document.getElementById("divCacheContents");
var curr_key = top_key;
@creamidea
creamidea / smart-table.coffee
Last active January 2, 2016 16:39
本来想制作一个智能表格的,但是没有写完。写贴在这里
$smartTable = $("#smart-table")
class Table
constructor: (option) ->
{@templateName, @$wrapper} = option
@context = [] #内部存储数据列表
click: (e) ->
$li = $(e.target)
action = $li.attr('action')
switch action
when "add"