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
Show hidden characters
{ | |
"cmd": ["bash", "$file"], | |
"file_regex": "^(.*): line ([0-9]*)", | |
"selector": "source.bash" | |
} |
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
# fetch our inbox, find subreddits we are banned from in advance | |
my_inbox = None | |
try: | |
my_inbox = r.user.get_inbox() | |
except: | |
#TODO: handle some exceptions here! | |
raise | |
if (my_inbox): | |
for m in my_inbox: | |
s = re.match("you have been banned from posting to \[.*\]\(/r/(.*)/\)\.",m.body) |
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
def persistent_post_comment(parent,comment,retries=3,debug=False): | |
result = None | |
while retries >= 0: | |
try: | |
if debug: | |
print "debug: comment: " + comment | |
else: | |
print "comment: " + comment | |
result = post_comment(parent,comment) | |
except reddit.errors.RateLimitExceeded as e: |
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
from FreeCAD import Base | |
box1 = Part.makeBox(1,4,9) | |
Part.show(box1) | |
box2 = Part.makeBox(1,4,9) | |
box2.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),60) # this line changes the behavior of the mirror | |
Part.show(box2) | |
box2 = box2.mirror(Base.Vector(2,4,9),Base.Vector(1,0,0)) # this mirror doesn't work correctly after the part has been rotated | |
Part.show(box2) |
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
from __future__ import division # allows floating point division from integers | |
from FreeCAD import Base | |
import sys | |
import math | |
try: | |
path = App.ConfigGet('UserHomePath') + '/FreeCad/Mod' | |
i = sys.path.index(path) | |
except: | |
sys.path.append(path) |
NewerOlder