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 pyautocad import Autocad, APoint | |
def find_diameter(load_kw): | |
if load_kw < 6: | |
return "DN25" | |
elif 6 <= load_kw < 13: | |
return "DN32" | |
elif 13 <= load_kw < 19: | |
return "DN40" | |
elif 19 <= load_kw < 39: |
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 pip | |
from subprocess import call | |
for dist in pip.get_installed_distributions(): | |
call("pip install --upgrade " + dist.project_name, shell=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
find . -name \*.doc -exec mv {} ~/Desktop/docx \; | |
find . -type d -empty -exec rmdir {} \; | |
find . -type d -empty -delete |
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 -*- | |
""" | |
Created on Fri Jun 12 23:18:02 2015 | |
@author: ZhuJiaqi | |
""" | |
# loop======================================================= | |
days = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"] | |
for i, d in enumerate(days): | |
print i, 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
defaults write com.apple.Finder AppleShowAllFiles YES |
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 | |
ls | while read -r FILE | |
do | |
mv -v "$FILE" `echo $FILE | tr ' ' '_' ` | |
done |
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
echo "" | |
echo -n "Welcome to Unix on Mac OS X, "; whoami | |
echo "" | |
echo -n "Today is "; date | |
echo "" | |
cal | |
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
fi |