Skip to content

Instantly share code, notes, and snippets.

@ibotdotout
ibotdotout / .cvimrc
Last active May 26, 2016 17:31
cVim,sVim config - colemak
let mapleader = " "
map n scrollDown
map e scrollUp
map r scrollDown
map w scrollUp
map dd scrollToTop
map D scrollToBottom
map dG previousTab
@ibotdotout
ibotdotout / .travis.yml
Created September 22, 2015 19:09
travis with jekyll
sudo: false
language: ruby
rvm:
- 2.2
script:
- bundle exec jekyll build
- bundle exec htmlproof ./_site --disable-external
@ibotdotout
ibotdotout / robot-packtpub.txt
Last active July 22, 2016 11:10
Robotframework script to claim free packtpub book
*** Settings ***
Library Selenium2Library
*** Variables ***
${USER} your@email.com
${PASSWORD} password
${BROWSER} phantomjs
${HOME URL} https://www.packtpub.com/packt/offers/free-learning
@ibotdotout
ibotdotout / .travis.yml
Created August 24, 2015 09:09
travis with python and other services
language: python
python:
- "2.7"
services:
- mongodb
install:
- pip install -r requirements.txt
@ibotdotout
ibotdotout / .travis.yml
Created August 24, 2015 09:08
travis with docker
sudo: required
language: python
services:
- docker
before_install:
- docker build -t robot-packtpub .
@ibotdotout
ibotdotout / line_send_msg_by_user_id.py
Last active August 29, 2015 14:26
send line message by using line ID
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"
@ibotdotout
ibotdotout / Line.Dockerfile
Last active August 29, 2015 14:26
Line Dockerfile - python2 on ubuntu
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
# 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"
@@ -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)
@ibotdotout
ibotdotout / fizzbuzz_ocp.py
Last active April 5, 2020 05:26
FizzBuzz with Open/closed principle
#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():