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 | |
| BOX=$1 | |
| if [ -z $BOX ]; then | |
| echo "Need argments." | |
| exit -1 | |
| fi | |
| if [ ! -e $BOX ]; then |
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 | |
| DEBS="https://github.com/LiuLang/kwplayer-packages/raw/master/python3-xlib_0.15-1_all.deb | |
| https://github.com/LiuLang/kwplayer-packages/raw/master/python3-keybinder_1.1.2-1_all.deb | |
| https://github.com/LiuLang/kwplayer-packages/raw/master/kwplayer_3.5.2-1_all.deb" | |
| # install dependencies | |
| sudo apt-get install python3-html2text python3-ply | |
| # download and install |
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 | |
| ./sc.sh -command graph -outputformat png -outputfile=graph.png -database=development.db -password= -user= -infolevel=standard |
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 | |
| import datetime | |
| from threading import Thread | |
| from Queue import Queue, Empty | |
| import sys | |
| class mseed2sac(): | |
| def __init__(self): | |
| self.start_time = datetime.datetime.now() |
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 -*- | |
| """dump gsettings""" | |
| from __future__ import print_function | |
| from subprocess import check_output | |
| def get_schemas(): | |
| output = check_output(['gsettings', 'list-schemas']) | |
| schemas = output.split('\n') |
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 | |
| # | |
| # backup_redmine.sh | |
| # modified by [email protected] | |
| # Inspiration: https://gist.github.com/gabrielkfr/6432185 | |
| # | |
| # Distributed under terms of the MIT license. | |
| # -- VARS | |
| DAY=`date +"%Y%m%d"` |
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
| #include <cstdio> | |
| #include <cstdlib> | |
| void insertionSort(int arr[], int length) { | |
| int i, j, tmp; | |
| for (i = 1; i < length; i++) { | |
| j = i; | |
| while (j > 0 && arr[j - 1] > arr[j]) { | |
| tmp = arr[j]; | |
| arr[j] = arr[j - 1]; |
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
| from cocos.director import * | |
| from cocos.scene import * | |
| from cocos.layer import * | |
| from cocos.sprite import * | |
| from cocos.text import * | |
| from cocos.actions import * | |
| class TutorialLayer(ColorLayer): | |
| def __init__(self): | |
| super(TutorialLayer, self).__init__(0, 0, 100, 255) |
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
| // db 是用 orm.connect({protocol: "mysql", ....}, function(err, db) {}); 的 callback 所帶出的。 | |
| var Category = db.define('category', { | |
| name: { type: 'text', required: true}, | |
| }, {} | |
| }); | |
| var Food = db.define('food', { | |
| name: { type: 'text', required: true}, | |
| price: { type: 'number', required: true}, | |
| }, {} | |
| }); |
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
| package com.example; | |
| import java.net.InetSocketAddress; | |
| import java.net.Socket; | |
| import java.io.BufferedOutputStream; | |
| import java.io.BufferedReader; | |
| import java.io.InputStreamReader; | |
| public class SocketClient { | |
| private String address = "127.0.0.1";// 連線的ip |