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:utf8 -*- | |
import requests | |
def run(): | |
url = 'http://deview.kr/2014/saveParticipant' | |
headers = { | |
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', | |
'Referer': 'http://deview.kr/2014/registParticipant', | |
'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 \ |
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
def init_log(app): | |
import os | |
if not os.path.exists('logs'): | |
os.makedirs('logs') | |
import logging | |
logging.basicConfig(filename='logs/db.log') | |
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) |
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
package com.example.androidta_refort; | |
public class MainActivity extends Activity { | |
RadioGroup rg; | |
ImageView iv;@ | |
Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
final TextView rtv = (TextView) findViewById(R.id.dtv); | |
final TextView rtv2 = (TextView) findViewById(R.id.dtv2); |
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
app.factory('Logger', function(localStorageService) { | |
var getUUID = function() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | |
return v.toString(16); | |
}); | |
}; | |
var createTouchEvent = function(el, x, 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
# -*- coding:utf-8 -*- | |
from flask import abort | |
from datetime import datetime | |
from project.ext import db | |
class IdMixin(object): | |
""" | |
Provides the :attr:`id` primary key column |
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 urllib, cStringIO | |
from wand.image import Image | |
url = 'http://img3.wikia.nocookie.net/__cb20100520131746/logopedia/images/5/5c/Google_logo.png' | |
f = cStringIO.StringIO(urllib.urlopen(url).read()) | |
i = Image(file=f) | |
>>> <wand.image.Image: 74d025d 'PNG' (3548x1243)> |
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
class SerializerMixin(object): | |
""" | |
Mixin class for models. | |
Model define:: | |
class User(SerializerMixin): | |
id = None | |
name = None | |
fields = ('id', 'name') | |
def __init__(self, _id, name): | |
self.id = _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
# -*- coding:utf-8 -*- | |
class LoupQuery(Query): | |
pass | |
db_session = scoped_session( | |
sessionmaker( | |
autocommit=False, | |
autoflush=False, |
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 boto3 | |
import time | |
timestamp = int(time.time()) | |
session = boto3.Session( | |
aws_access_key_id=aws_access_key_id, | |
aws_secret_access_key=aws_secret_access_key, | |
region_name=region_name | |
) |
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
println(Jenkins.getAuthentication().getAccessToken()); |