Skip to content

Instantly share code, notes, and snippets.

View sailfish009's full-sized avatar

sailfish009

  • freelancer
  • South Korea
View GitHub Profile
@sailfish009
sailfish009 / processify.py
Created May 27, 2020 03:57 — forked from schlamar/processify.py
processify
import os
import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.
Be sure that every argument and the return value
https://www.dyn-web.com/javascript/arrays/add.php
https://help.ubuntu.com/community/PortKnocking
https://github.com/babel/babel-eslint/issues/681
// TODO: Remove when is https://github.com/babel/babel-eslint/issues/530 fixed
rules : {
"template-curly-spacing" : "off",
indent : "off"
}
// vue.js get data from response
.then(response => {
response.data
}
# python response with json data
def some_func():
response.content_type = 'application/json'
rv = [{"id":1, "user": "testuser", "permissions": "test", "token": "abcdefg"}]
return dict(data=rv)
@sailfish009
sailfish009 / bottle-cors.py
Last active May 14, 2020 13:04 — forked from richard-flosi/bottle-cors.py
Bottle with Cross-origin resource sharing (CORS)
"""
Example of setting up CORS with Bottle.py.
"""
from bottle import Bottle, request, response, run
app = Bottle()
@app.hook('after_request')
def enable_cors():
"""
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
https://launchschool.com/books/sql_first_edition/read/multi_tables
절대 회사가 원하는대로 살지 말라
https://www.youtube.com/watch?v=KSd8HXQ-7Vw
#! /bin/sh
# /usr/local/bin/firefox
/opt/firefox/firefox -width=1600 -height=1000