Skip to content

Instantly share code, notes, and snippets.

View Cam1337's full-sized avatar

Cameron Wrigley Cam1337

  • Amazon Web Services
  • Seattle, WA
View GitHub Profile
15:07 [freenode] -ctcp:Ttech- WHOIS
15:06 [freenode] CTCP WHOIS reply from Ttech:
15:06 [ttech] Ttech [~ttech@botters/staff/ttech]
15:06 [ttech] (*) ircname : Thomas Techinus
15:06 [ttech] (*) channels : @#botters +##symetrikproductions
cam@flex In(~) Time(17:48:40)$ cdgit
cam@flex In(~/git/python/pyirc) Time(17:48:42)$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: ccmds.py
#
no changes added to commit (use "git add" and/or "git commit -a")
def CheckGit(self):
#Twisted attack http://gist.github.com/379664
if len(self.args)>=5:
try:
if self.args[4]=="cam":
GitURL="http://github.com/Cam1337/PyIRC/commits/master.atom"
else:
GitURL="http://github.com/%s/%s/commits/master.atom" % (self.args[4], self.args[5])
Page = (BeautifulSoup(urllib2.urlopen(GitURL)))
MostRecentCommit = str(Page("content")[0]).split("gt;m")[1].split("&lt")[0].strip()
cam@g-mac In(~/git/python/pyirc) Time(18:43:18)$ git pull
warning: no common commits
remote: Counting objects: 1136, done.
remote: Compressing objects: 100% (870/870), done.
remote: Total 1136 (delta 198), reused 819 (delta 17)
Receiving objects: 100% (1136/1136), 173.38 KiB | 104 KiB/s, done.
Resolving deltas: 100% (198/198), done.
From ssh://ssh.github.com:443/Cam1337/PyIRC
* [new branch] master -> origin/master
You asked me to pull without telling me which branch you
cam@g-mac In(~) Time(18:39:29)$ cdgit
cam@g-mac In(~/git/python/pyirc) Time(18:39:31)$ git add cmds.py
cam@g-mac In(~/git/python/pyirc) Time(18:39:41)$ git commit -m "Added comments at the top"
[master 5f3afeb] Added comments at the top
1 files changed, 1 insertions(+), 0 deletions(-)
cam@g-mac In(~/git/python/pyirc) Time(18:39:49)$ git remote show origin
Password:
* remote origin
Fetch URL: https://[email protected]/Cam1337/PyIRC.git
Push URL: https://[email protected]/Cam1337/PyIRC.git
* remote origin
Fetch URL: ssh://[email protected]:443/Cam1337/PyIRC.git
Push URL: ssh://[email protected]:443/Cam1337/PyIRC.git
HEAD branch: master
Remote branch:
master new (next fetch will store in remotes/origin)
Local ref configured for 'git push':
error: src refspec master does not match any.
error: failed to push some refs to 'ssh://[email protected]:443/Cam1337/PyIRC.git'
cam@g-mac In(~/git/python/pyirc) Time(17:09:01)$
def Weather(self):
if len(self.args)==5:
try:
Zipcode=self.args[4].lower()
Page = (BeautifulSoup(urllib2.urlopen("http://www.weather.com/weather/today/%s" % Zipcode)))
CurrentTemperature=str(Page.find("div", { "class" : "ccTemp" })).split(">")[1].split("<")[0].replace("&deg; ","")
CurrentState=str(Page.find("div", { "class" : "ccdata" })).split("<p>")[1].split("</p>")[0].lower()
City=str(Page.find("h1")).split(">")[1].split("(%s)"%Zipcode)[0].strip()
Wind=" ".join(str(Page.find("div", { "class" : "ccWind" })).split("<b>")[1].split("</b>")).replace("\n","").replace("\t","").replace("gusting"," gusting").split("</div>")[0].strip().lower()
TotalDescription="weather for %s: %s and %s with wind %s" % (City, CurrentTemperature, CurrentState, Wind)
def PrintTerminal(self):
Log = open("/Users/Cam/Git/Python/IRC/logs.txt", "a")
if self.args[1].lower() == "part":
pString="%s has parted %s" % (self.Nick, self.args[2])
elif self.args[1].lower() == "join":
pString="%s has joined %s" % (self.Nick, self.args[2][1:])
elif self.args[1]=="QUIT":
pString="%s has quit - ['%s']" %(self.Nick, " ".join(self.args[2:])[1:])
elif self.args[0]=="PING":
pString="You have been pinged by %s" % self.args[1]
#This was written directly into git. No testing;
equation=raw_input("What is your equation (please use x as a variable): ")
lookfor=raw_input("Factor Number (leave blank for 0): ")
for x in range(1000):
equation=equation.replace("^","**")
answer=eval(equation)
if answer==lookfor:
print "The answer was %s" % x