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 | |
import os | |
import sys | |
import time | |
from watchdog.observers import Observer | |
from watchdog.events import PatternMatchingEventHandler | |
def when_file_changed(filename): | |
""" |
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
x = 105 | |
if x%7 == 0 and x%3 == 0 and x%5 == 0: | |
print("FizzBuzzBang") | |
elif x%7 == 0 and x%5 == 0: | |
print("BuzzBang") | |
elif x%7 == 0 and x%3 == 0: | |
print("FizzBang") | |
elif x%3 == 0 and x%5 == 0: | |
print("FizzBuzz") |
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
#Kata with Up1 - Agile Thailand 2014 @ Eng CU | |
#Sat 7 June 2014 | |
class FizzBuzzFactory(): | |
def create(self): | |
rules = [FizzBuzzBangRule(), BuzzBangRule(), FizzBangRule(), FizzBuzzRule(), | |
BangRule, BuzzRule(),FizzRule(),NormalRule()] | |
return FizzBuzz(rules) | |
class FizzBuzz(): |
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
@@ -55,7 +55,21 @@ | |
After login, make `client` and `client_in` instance | |
to communicate with LINE server | |
""" | |
- raise Exception("Code is removed because of the request of LINE corporation") | |
+ | |
+ self.transport = THttpClient.THttpClient(self.LINE_HTTP_URL) | |
+ self.transport_in = THttpClient.THttpClient(self.LINE_HTTP_IN_URL) | |
+ | |
+ self.transport.setCustomHeaders(self._headers) |
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
# original: https://github.com/carpedm20/LINE/blob/master/examples/echobot.py | |
from line import LineClient, LineGroup, LineContact | |
try: | |
client = LineClient("ID", "PASSWORD") | |
print client.authToken #print authToken before error and use this login again | |
#client = LineClient(authToken="AUTHTOKEN") | |
except: | |
print "Login Failed" |
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 dockerfile/python | |
RUN apt-get update -y && apt-get dist-upgrade -y | |
# Apache Thrift for line support | |
# http://www.saltycrane.com/blog/2011/06/install-thrift-ubuntu-1010-maverick/ | |
RUN apt-get install -y automake libtool flex bison pkg-config g++ libssl-dev make libqt4-dev git \ | |
debhelper cmake | |
RUN cd /tmp && curl http://archive.apache.org/dist/thrift/0.9.1/thrift-0.9.1.tar.gz | tar zx |
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 line import LineClient, LineGroup, LineContact | |
try: | |
client = LineClient("ID", "PASSWORD") | |
print client.authToken #print authToken before error and use this login again | |
#client = LineClient(authToken="AUTHTOKEN") | |
except: | |
print "Login Failed" | |
lineID = "Enter target LineID" |
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
sudo: required | |
language: python | |
services: | |
- docker | |
before_install: | |
- docker build -t robot-packtpub . | |
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
language: python | |
python: | |
- "2.7" | |
services: | |
- mongodb | |
install: | |
- pip install -r requirements.txt |
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
*** Settings *** | |
Library Selenium2Library | |
*** Variables *** | |
${USER} [email protected] | |
${PASSWORD} password | |
${BROWSER} phantomjs | |
${HOME URL} https://www.packtpub.com/packt/offers/free-learning |
OlderNewer