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
alice = Player(name='Alice', point=100) | |
alice.save() | |
bob = Player(name='Bob', point=100) | |
bob.save() | |
// in django 1.5 | |
141017 18:09:02 51 Connect django@localhost on django | |
51 Query SET NAMES utf8 | |
51 Query set autocommit=0 |
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
# coding=utf-8 | |
from __future__ import unicode_literals | |
def suddendeath(msg): | |
""" | |
_人人人人_ | |
> msg < | |
 ̄Y^Y^Y^Y ̄ | |
""" |
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 os import path | |
import os | |
from io import BytesIO | |
from wand.image import Image | |
from PyPDF2 import PdfFileWriter, PdfFileReader | |
base_dir = path.dirname(__file__) | |
data_dir = path.join(base_dir, '..', 'data') | |
asset_dir = path.join(base_dir, '..', 'out') |
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
import os | |
import re | |
import mimetypes | |
import shutil | |
import datetime | |
import requests | |
import rsa | |
def encrypt(key_str, uid, upw): |
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
<!doctype html> | |
<html> | |
<head></head> | |
<body> | |
<script src="//www.google-analytics.com/analytics.js"></script> | |
<script> | |
if (ga) { | |
ga('create', '########ID#######', 'auto'); | |
ga('send', 'pageview'); | |
} |
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
import requests | |
from bs4 import BeautifulSoup as Soup | |
import settings | |
sess = requests.Session() | |
resp = sess.get('https://www.packtpub.com/packt/offers/free-learning') | |
soup = Soup(resp.content, 'html.parser') | |
build_id_input = soup.select_one('#packt-user-login-form input[name=form_build_id]') |
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
import json | |
import requests | |
from bs4 import BeautifulSoup as Soup | |
response = requests.get('https://www.korbit.co.kr/eth_market') | |
soup = Soup(response.text, 'lxml') | |
order = soup.select_one('div[data-react-class=MarketDataBlock]') | |
props_str = order['data-react-props'] |
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
import json | |
import requests | |
from bs4 import BeautifulSoup as Soup | |
from googleapiclient.discovery import build | |
import config | |
def correct(text): | |
text = text.replace('\n', ' ') |
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 IPython.html.widgets import DOMWidget | |
from IPython.utils.traitlets import Bool | |
from IPython.core.display import display, HTML, Javascript | |
from uuid import uuid4 | |
class BulbWidget(DOMWidget): | |
# _view_name = | |
status = Bool(False, sync=True) |
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 IPython.html.widgets import DOMWidget | |
from IPython.utils.traitlets import Bool | |
from IPython.core.display import display, HTML, Javascript | |
from uuid import uuid4 | |
class SevenSegWidget(DOMWidget): | |
disabled = Bool(False) | |
led_0 = Bool(False, sync=True) | |
led_1 = Bool(False, sync=True) |
OlderNewer