Skip to content

Instantly share code, notes, and snippets.

[root@web144135 code]# more common.py
#!/usr/bin/env python
'''
This module contains some common routines used by other samples.
'''
# Python 2/3 compatibility
from __future__ import print_function
import sys
@zhenchuan
zhenchuan / demo.html
Created September 21, 2017 23:50
jquery prop vs attr
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="application/javascript" src="jquery.js"></script>
<style>
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
def data = """
<div id="app">
<h1>{{msg}}</h1>
<input type="text" m-model="msg"/>
</div>
""".toCharArray()
def state = [idx:0,tokens:[],data:data]
def text(state){
@zhenchuan
zhenchuan / inode_check.rb
Last active December 31, 2021 10:25
modify inode/dev/verison info( which may changes after re_mount ) in sincedb file when using logstash's logstash-input-file plugin on nfs
require 'fileutils'
require 'optparse'
require 'pathname'
# 格式: ruby check_inode.rb --dry_run false --sincedb=/tmp/a.txt
# InodeStruct.new(@inode, stat.dev_major, stat.dev_minor)
def inode_struct(file_name)
stat = File.stat(file_name)
inode = stat.ino.to_s