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
''=~( '(?{' .('`' |'%') .('[' ^'-') | |
.('`' |'!') .('`' |',') .'"'. '\\$' | |
.'==' .('[' ^'+') .('`' |'/') .('[' | |
^'+') .'||' .(';' &'=') .(';' &'=') | |
.';-' .'-'. '\\$' .'=;' .('[' ^'(') | |
.('[' ^'.') .('`' |'"') .('!' ^'+') | |
.'_\\{' .'(\\$' .';=('. '\\$=|' ."\|".( '`'^'.' | |
).(('`')| '/').').' .'\\"'.+( '{'^'['). ('`'|'"') .('`'|'/' | |
).('['^'/') .('['^'/'). ('`'|',').( '`'|('%')). '\\".\\"'.( '['^('(')). | |
'\\"'.('['^ '#').'!!--' .'\\$=.\\"' .('{'^'['). ('`'|'/').( '`'|"\&").( |
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
/* | |
gulp clean && gulp build && gulp templates | |
OH GOD WHY SO JAVASCRIPT | |
*/ | |
"use strict" | |
var gulp = require("gulp"), | |
$ = require("gulp-load-plugins")(); |
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 tornado.gen import coroutine | |
from tornado.web import RequestHandler | |
from tornado.web import Application | |
from tornado.ioloop import IOLoop | |
import rethinkdb.net as net | |
import rethinkdb as r | |
connection = r.connect(host='localhost') | |
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 xml.etree import ElementTree as et | |
from xml.dom import minidom | |
""" | |
Convert Python dict to XML using a special set of rules | |
Function build_xml takes a specialy formatted dict and returns xml.etree.ElementTree Element. | |
1) There can be only one Root Element, it must be at a top-level of a dictionary and it should be the only element at | |
top-level | |
2) Keys are element names, key values should be dicts with element params. | |
3) If there should be more than one elements with the same name, key value could be a list of dicts with params. |
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
# Case One: How /it should be/ done: | |
class CloudStorageRaises(object): | |
def upload_picture(file): | |
try: | |
url = self.storageApi.upload_from_file(file).generate_url() | |
return url | |
except Exception as e: |
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
{ | |
"type": "object", | |
"properties": { | |
"mainPhoto": {"type": "string"}, | |
"propertyType": {"type": "string"}, | |
"price": { | |
"type": "object", | |
"properties": { | |
"USD": {"type": "number"}, | |
"RUB": {"type": "number"} |
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
if object_['landProperties']: | |
if object_['landProperties']['landscapeType']: | |
if 'landtype' in object_['landProperties']['landscapeType']: | |
if object_['landProperties']['landscapeType']['landtype']: | |
if isinstance(object_['landProperties']['landscapeType']['landtype'], str): | |
object_['landProperties']['landscapeType']['landtype'] = \ | |
object_['landProperties']['landscapeType']['landtype'].split(',') | |
object_['landProperties']['landscapeType'] = ", ".join([ | |
self.dictionary['land_type'][land_type].lower() | |
for land_type in object_['landProperties']['landscapeType']['landtype'] |
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
auth.singInWebapi = (user) => { | |
return new $q((resolve, reject) => { | |
const address = `${$API.url}Token`; | |
const request = new XMLHttpRequest; | |
const handleResponse = () => { | |
const { status } = request; | |
if (request.readyState === request.DONE) { | |
if (status > 0) { | |
const body = JSON.parse(request.response); |
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 Run | |
$API.setHeader(`Content-Type`, `application/json`); | |
// Take One | |
const headers = new Map(); | |
headers[`Content-Type`] = `multipart/form-data`; | |
console.log(headers) | |
// Map{} Content-Type: `multipart/form-data`; | |
$API.post('UploadAvatar', formData, {headers}); | |
// Request Header: Content-Type: application/json; |
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
server { | |
listen 80; | |
root "/var/www/dev.kancolle.io/dist"; | |
server_name "dev.kancolle.io"; | |
location / { | |
try_files $uri /index.html; | |
} | |
} |
OlderNewer