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 AppConfig{ | |
bool is_login ; | |
String username; | |
AppConfig({this.is_login, this.username}); | |
} | |
class MyApp{ | |
static AppConfig appconfig = new AppConfig(is_login: false, username: "guest"); | |
static updateConfig(AppConfig aconfig){ | |
appconfig = aconfig; | |
} |
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
require "restclient" | |
require "json" | |
#@keyword = URI::decode("新闻快讯") | |
@keyword = "学校公告" | |
start = '0' | |
lmt = '10' | |
@kword = @keyword.encode("GB2312","UTF-8") | |
kword = URI::encode(@kword) | |
lurl = "http://www.lwqzx.sdedu.net/kernel/net_school/active_app/login1.php" |
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/sh | |
rsync -e 'ssh -p 22' -avz [email protected]:/data/run /data/ecbackup | |
sleep 1 | |
echo "Run is backup" | |
echo "------------------------------------------------------------" | |
rsync -e 'ssh -p 22' -avz [email protected]:/etc/init/{wx,ndc,xtiku,bttrack,caddy,dljy,kpy,mongod,mongodb,qiku,tbcms,lab}.conf /data/ecbackup/upstart | |
sleep 1 | |
echo "Upstart script is backup" | |
echo "------------------------------------------------------------" |
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 ruby | |
require "tmpdir" | |
dbpath = "/data/dbback" | |
file = `find #{dbpath} -type f -printf "%p\n" | sort -rn | head -n 1 ` | |
Dir.mktmpdir do |dir| | |
`tar -C #{dir} -zxvf #{file} ` | |
basename = File.basename(file,".gz") | |
rdir =dir+"/"+basename.gsub(".tar.gz","") | |
`mongorestore --drop --quiet #{rdir}` | |
end |
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
find /data/dbback -type f -printf "%C@ %p\n" | sort -rn | head -n 10 |
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 ruby | |
require 'socket' | |
room = ARGV[0] | |
hostname = 'localhost' | |
port = 2000 | |
TCPSocket.open(hostname,port) {|server| | |
server.puts room | |
result = server.gets |
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 ruby | |
require 'socket' | |
def crooms | |
{ | |
'301' => ['192.168.7.1','192.168.7.54'], | |
'303' => ['192.168.5.1','192.168.5.51'], | |
'304' => ['192.168.6.1','192.168.6.48'], | |
'401' => ['192.168.1.1','192.168.1.51'], |
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/sh | |
rsync -avz [email protected]:/data/run /data/ecbackup | |
sleep 1 | |
echo "Run is backup" | |
echo "------------------------------------------------------------" | |
rsync -avz [email protected]:/etc/init/{wx,ndc,tiku,bttrack,caddy,dljy,gnath,kpy,mongod,mongodb,qiku,tbcms}.conf /data/ecbackup/upstart | |
sleep 1 | |
echo "Upstart script is backup" | |
echo "------------------------------------------------------------" |
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
Drawable = Android::Graphics::Drawable::Drawable | |
BitmapFactory = Android::Graphics::BitmapFactory | |
Toast = Android::Widget::Toast | |
Url = Java::Net::URL | |
class MyAsyncTask < Android::Os::AsyncTask | |
attr :img | |
def doInBackground(params) | |
@img = params[1] | |
puts "doInBackground #{params}" |
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_source "https://ruby.taobao.org/" | |
gem 'slim-rails' | |
gem 'mongoid' | |
gem 'puma' | |
gem 'bootstrap-sass' | |
gem 'font-awesome-sass' | |
gem 'zbox' | |
app_name = ask("What is your app name ?") |