This file contains hidden or 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
| function onOpen() { | |
| var ui = DocumentApp.getUi(); | |
| ui.createMenu('工具') | |
| .addItem('更新文件索引', 'updateHomePage') | |
| .addToUi(); | |
| } | |
| function updateHeader(body, title) { | |
| body.insertParagraph(0, title) |
This file contains hidden or 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
| class LazyProperty: | |
| def __init__(self, method): | |
| self.method = method | |
| self.method_name = method.__name__ | |
| print('function overriden: {}'.format(self.method)) | |
| print('function\'s name: {}'.format(self.method_name)) | |
| def __get__(self, obj, cls): | |
| if not obj: |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import boto3 | |
| import click | |
| def tagging(bucket_name, key, tag_set): | |
| client = boto3.client('s3') | |
| res = client.put_object_tagging( | |
| Bucket=bucket_name, | |
| Key=key, |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| # local | |
| import sys | |
| # third-party | |
| import boto3 | |
| from botocore.exceptions import ClientError | |
This file contains hidden or 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
| #!/usr/bin/env python | |
| from influxdb import InfluxDBClient | |
| ''' | |
| Repo: https://github.com/influxdata/influxdb-python | |
| ''' | |
| def write(json_body): | |
| client = InfluxDBClient(HOST, port=PORT, username=USERNAME, password=PASSWORD, database=DATABASE) | |
| client.create_database(DATABASE) |
This file contains hidden or 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
| #/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import subprocess | |
| import os | |
| import click | |
| @click.command() | |
| @click.option('-s', '--source') |
This file contains hidden or 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 npid = require('npid'); | |
| // node service.js -p /var/run/service.pid | |
| var pid = npid.create(process.argv[3]) | |
| var pid = npid.create('./example.pid'); | |
| pid.removeOnExit(); | |
| function exit() { | |
| process.exit(0); | |
| } |
This file contains hidden or 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
| #!/bin/bash | |
| # Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 14.04 | |
| # Copyright @ 2014 Shuen-Huei (Drake) Guan <drake.guan@gmail.com> | |
| # References: | |
| # * https://gist.github.com/xdamman/e4f713c8cd1a389a5917 | |
| # * https://blog.dlasley.net/2013/05/install-ffmpeg-from-source/ | |
| # * http://fermat-little-theorem-blog.logdown.com/posts/203069-solved-when-building-gpac-suffer-usr-local-lib-libswscalea-error-adding-symbols-bad-value |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import parmap | |
| import path | |
| import shlex | |
| import subprocess | |
| import sys | |
| import time |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import json | |
| import urllib2 | |
| def get_data_from_google_spreadsheet(url): | |
| data_json = urllib2.urlopen(url) | |
| data_dict = json.load(data_json) |
NewerOlder