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
#!/usr/bin/env python3 | |
import gzip | |
import os | |
import re | |
import urllib.request | |
DOWNLOAD_FILE = 'cidr.txt.gz' | |
urllib.request.urlretrieve( |
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 | |
from requests_oauthlib import OAuth1Session, OAuth1 | |
import requests | |
import settings | |
class APIClient(object): |
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
var http = require('http'); | |
var server = http.createServer(); | |
var apns = require('apn'); | |
var options = { | |
cert: './cert.pem', | |
key: './key.pem', | |
gateway: 'gateway.sandbox.push.apple.com', | |
port: 2195, | |
}; |
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
### Django ### | |
*.log | |
*.pot | |
*.pyc | |
__pycache__/ | |
local_settings.py | |
db.sqlite3 | |
media | |
staticfiles/ |
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 bottle import route, run, HTTPResponse | |
@route('<url:path>') | |
def callback(url): | |
body = 'ただいまアクセスが集中しているため、サイトが繋がりづらい状態になっています。 ご迷惑をおかけして申し訳ありません。' | |
r = HTTPResponse(status=503, body=body) | |
r.set_header('Content-Type', 'document') | |
return r | |
if __name__ == '__main__': |
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
### Xcode ### | |
# Xcode | |
# | |
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore | |
## Build generated | |
build/ | |
DerivedData/ | |
## Various settings |
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 -eu | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
sudo apt-get install -y git build-essential libffi-dev libssl-dev zlib1g-dev liblzma-dev libbz2-dev libreadline-dev libsqlite3-dev | |
git clone https://github.com/yyuu/pyenv.git ~/.pyenv | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc |
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/sh | |
MERGEPBX_TARGET=mergepbx | |
MERGEPBX_PREFIX=/usr/local/bin | |
MERGEPBX_BUILD_DIR=/tmp | |
MERGEPBX_REPO=https://github.com/simonwagner/mergepbx.git | |
build() | |
{ | |
cd $MERGEPBX_BUILD_DIR/$MERGEPBX_TARGET |
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 urllib.request import urlopen | |
from bs4 import BeautifulSoup | |
html = urlopen('http://nikkei225jp.com/chart/') | |
soup = BeautifulSoup(html , "html.parser") | |
nikkei = soup.find('div' , class_ = 'if_cur') | |
price = nikkei.string | |
print(price) |
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
#!/usr/bin/env python3 | |
# coding: utf-8 | |
from tweepy.streaming import StreamListener, Stream | |
from tweepy.auth import OAuthHandler | |
from tweepy.api import API | |
from datetime import timedelta | |
import os | |
import mysql.connector |