This file contains 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 ballList = []; | |
function createBall(){ | |
var ball = document.createElement("div"); | |
var r = 10+Math.random()*100; | |
var density = 0.01; // 密度 | |
ball.redis = r/2; // 半径 | |
ball.name = "ball"+ballList.length; | |
ball.velocity = {"x":0,"y":0}; // 速度 | |
ball.acceleration = {"x":0,"y":0}; // 加速度 | |
ball.mess = 4.0/3*Math.PI*ball.redis*ball.redis*ball.redis*density; // 质量 |
This file contains 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 | |
while true | |
do | |
data=`curl "http://admin:admin@192.168.1.1/userRpm/SystemStatisticRpm.htm" | grep "90-C1-15-XX-XX-XX"|cut -d"," -f7` | |
if [ $data -ne 0 ] | |
then | |
notify-send 快开门 | |
mpg321 /opt/ring.mp3 | |
break | |
fi |
This file contains 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 sys | |
import qiniu.conf | |
import qiniu.rs | |
import qiniu.io | |
qiniu.conf.ACCESS_KEY = '*****************' | |
qiniu.conf.SECRET_KEY = '*****************' |
This file contains 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
f, err := os.Open("a.txt") | |
defer f.Close() | |
if nil == err { | |
buff := bufio.NewReader(f) | |
for { | |
line, err := buff.ReadString('\n') | |
if err != nil || io.EOF == err{ | |
break | |
} | |
fmt.Println(line) |
This file contains 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 | |
# rm有风险,先将文件移动到/tmp/目录,在关机之前文件文件还是存在的,重启后才删除 | |
mv -f $* /tmp/ |
This file contains 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 main | |
import ( | |
"bufio" | |
"encoding/base64" | |
"flag" | |
"fmt" | |
"log" | |
"os" | |
) |
This file contains 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 | |
pulls="repo1 repo2 repo3" | |
fetchs="repo4 repo5" | |
branch="yourBranch" | |
remote="yourRemoteGitName" | |
for i in $pulls | |
do | |
echo ">>>>>>>>$i" | |
cd $i | |
git remote -v |
This file contains 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 os | |
from mutagen.mp3 import MP3 | |
from mutagen.easyid3 import EasyID3 | |
dir = "/home/ma6174/Music/" | |
for i in os.listdir(dir): | |
real_path = dir + i | |
id3info = MP3(real_path, ID3=EasyID3) |
This file contains 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 urllib | |
import BeautifulSoup | |
import sys | |
import Queue | |
import threading | |
import logging |
This file contains 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
alias fgo='find . -name "*.go" -type f | xargs -I {} grep {} ~/empty -i --color=auto -n -e ' |
OlderNewer