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
# conding: utf-8 | |
import os | |
import os.path | |
target_path = '/path/to/rename/ | |
def main(): | |
cnt = 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "chef/centos-6.5" | |
config.vm.network :private_network, ip: "192.168.33.31" | |
config.vm.provision "shell", inline: <<-EOT |
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
javascript:(function()%7Bconsole.log(document.getElementById("webMessengerRecentMessages").innerText)%3B%7D)()%3B |
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
#include <Process.h> | |
void c_print(Process p){ | |
while(p.available()>0){ | |
char c = p.read(); | |
Serial.print(c); | |
} | |
Serial.flush(); | |
} |
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 | |
import os | |
target_path = './target/' | |
def main(): | |
for dpath,dnames,fnames in os.walk(target_path): | |
for fname in fnames: |
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 | |
import os | |
import hashlib | |
import sqlite3 | |
target_path = './20140620/' | |
db_path = './logs.db' | |
file_output = './output.txt' |
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 titles = document.getElementsByTagName("title"); | |
var title = (titles.length > 0) ? titles[0].innerHTML: ""; | |
var metas = document.getElementsByTagName("meta"); | |
var description = ""; | |
var keywords = ""; | |
for (i=0; i<metas.length; i++){ | |
var meta_name = metas[i].getAttribute("name"); | |
if (meta_name=="description"){ | |
description = metas[i].getAttribute("content"); | |
} else if (meta_name=="keywords"){ |
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 | |
from BeautifulSoup import BeautifulSoup | |
import urllib2 | |
import json | |
def crawl(tmp_url): | |
page = urllib2.urlopen(tmp_url) | |
soup = BeautifulSoup(page.read()) |
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 tab_0 = document.getElementById("tab_0"); | |
var tab_1 = document.getElementById("tab_1"); | |
var tab_2 = document.getElementById("tab_2"); | |
var tab_3 = document.getElementById("tab_3"); | |
tab_0.style.display = ""; | |
tab_1.style.display = ""; | |
tab_2.style.display = ""; | |
tab_3.style.display = ""; |
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 | |
import datetime | |
def print_days(birth_year, birth_month, birth_day, target_year): | |
birth_day = datetime.date(birth_year, birth_month, birth_day) | |
today = datetime.date.today() | |
last_day = datetime.date(birth_day.year + target_year, birth_day.month, birth_day.day) | |
print last_day |
NewerOlder