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/python | |
#This is a PyGTK test | |
import gtk | |
import sys | |
class PyApp(gtk.Window): | |
def __init__(self): | |
super(PyApp,self).__init__() | |
self.set_title("PWM") | |
self.set_size_request(250,200) |
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
# -*- coding: utf-8 -*- | |
# !/usr/bin/python | |
# Filename: change_tint2_color.py | |
# 删除某个文件夹里的讨厌的空白图像(圣光) | |
from PIL import Image | |
import fnmatch | |
import os |
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
# -*- coding: utf-8 -*- | |
from datetime import datetime | |
from multiprocessing import Process | |
from time import sleep | |
import tkinter as tk | |
class Application(tk.Frame): | |
def __init__(self, master=None): | |
tk.Frame.__init__(self, master) |
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
import os.path, os, time, datetime | |
time_now = datetime.datetime.now() | |
for root, dirs, files in os.walk("image"): | |
for file_name in files: | |
file_path = root + '/' + file_name | |
file_exten = os.path.splitext(file_name)[1] | |
if not file_name[0] == '.': | |
if (file_exten == '.jpg' or file_exten == '.png' or file_exten == '.JPG' or file_exten == '.mp4' or file_exten == '.jpeg' or file_exten == '.mov' or file_exten == '.gif'): | |
#m_time = datetime.datetime.fromtimestamp(os.path.getmtime(file_path)) | |
new_file_name = time_now.strftime('%Y-%m-%d %H.%M.%S') + file_exten.lower() |
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 | |
source ./admin.sh | |
nova list --all-tenant | grep ERROR|awk '{print $2}' > ./uuid.temp | |
cat ./uuid.temp | xargs -n1 nova reset-state --active | |
cat ./uuid.temp |xargs -n1 nova reboot --hard | |
rm -f ./uuid.temp |
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
// Copyright 2012 The Go Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// +build !plan9 | |
package main | |
import ( | |
"log" |
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 python2 | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
import BaseHTTPServer | |
class CORSRequestHandler (SimpleHTTPRequestHandler): | |
def end_headers (self): | |
self.send_header('Access-Control-Allow-Origin', '*') | |
SimpleHTTPRequestHandler.end_headers(self) | |
if __name__ == '__main__': |
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
/** | |
* MongoDB NodeJS Driver Production Connection Example | |
* | |
* Copyright (c) 2015 ObjectLabs Corporation | |
* Distributed under the MIT license - http://opensource.org/licenses/MIT | |
*/ | |
var MongoClient = require('mongodb').MongoClient; | |
/** |
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
// Equals check if two Resources are equals. | |
func Equals(r1, r2 *Obj) bool { | |
r1JSON, _ := json.Marshal(r1) | |
r2JSON, _ := json.Marshal(r2) | |
if string(r1JSON) == string(r2JSON) { | |
return true | |
} | |
return false | |
} |
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
# Add init repo | |
mkdir hello | |
cd hello | |
git init | |
echo "Hello World" > README.md | |
git add . && git commit -m "Add README.md" | |
# Add empty vendor dir | |
git checkout --orphan vendor |