Skip to content

Instantly share code, notes, and snippets.

View DEKHTIARJonathan's full-sized avatar
👨‍🚀
Focused on breaking the speed of light. Beam me up, Scotty

Jonathan DEKHTIAR DEKHTIARJonathan

👨‍🚀
Focused on breaking the speed of light. Beam me up, Scotty
View GitHub Profile
@DEKHTIARJonathan
DEKHTIARJonathan / deploy.prototxt
Created September 6, 2016 08:33
DMU-Net model
input: "data"
input_shape {
dim: 1
dim: 1
dim: 224
dim: 224
}
layer {
name: "conv1/7x7_s2"
type: "Convolution"
@DEKHTIARJonathan
DEKHTIARJonathan / api.py
Last active November 13, 2016 15:25
Rapid API Prototyping with Bottle.py - api.py - V3
################## Import Libraries ##################
import os.path
from bottle import route, run, response, static_file, request, error, Bottle, template
from json import dumps, loads, load
################## WebService Route / ##################
class API:
def __init__(self, port, local):
self._app = Bottle()
self._route() # During initialisation we launch the _route() method to register the routes enabled
@DEKHTIARJonathan
DEKHTIARJonathan / api.py
Created November 13, 2016 15:19
Rapid API Prototyping with Bottle.py - API.py v1
####################### Import Libraries #######################
import os.path
from bottle import route, run, response, static_file, request, error, Bottle, template
from json import dumps, loads, load
####################### WebService Route / #######################
class API:
def __init__(self, port, local):
self._app = Bottle()
self._local = local
@DEKHTIARJonathan
DEKHTIARJonathan / conf.xml
Created November 13, 2016 15:21
Rapid API Prototyping with Bottle.py - Conf.xml
<!-- ############### Config File ################ -->
<config>
<APIserver serverName="serverAPI" local="false" ip="127.0.0.1" port="8080"/>
</config>
@DEKHTIARJonathan
DEKHTIARJonathan / loadConf.py
Created November 13, 2016 15:22
Rapid API Prototyping with Bottle.py - loadConf.py
################ Import Libraries ################
import os.path
import xml.etree.ElementTree as XML
def loadAPIConf(confPath = 'conf.xml'):
configurations = XML.parse(confPath).getroot()
servers = dict()
@DEKHTIARJonathan
DEKHTIARJonathan / server.py
Created November 13, 2016 15:22
Rapid API Prototyping with Bottle.py - server.py
################ Import Libraries ################
import os.path
import sys
from loadConf import loadAPIConf #We load the function created in the file : loadConf.py
import api #Don't worry about this line yet
####################################################################
configAPI = loadAPIConf() #We launch the function created in the file : loadConf.py
@DEKHTIARJonathan
DEKHTIARJonathan / index.html
Created November 13, 2016 15:24
Rapid API Prototyping with Bottle.py - index.html
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>
</title>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<style class="custom-css">
@DEKHTIARJonathan
DEKHTIARJonathan / api.py
Created November 13, 2016 15:24
Rapid API Prototyping with Bottle.py - api.py - V2
################## Import Libraries ##################
import os.path
from bottle import route, run, response, static_file, request, error, Bottle, template
from json import dumps, loads, load
################## WebService Route / ##################
class API:
def __init__(self, port, local):
self._app = Bottle()
self._route() # During initialisation we launch the _route() method to register the routes enabled
@DEKHTIARJonathan
DEKHTIARJonathan / reset.sql
Created November 20, 2016 15:11
Reset a PostgreSQL Database
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
@DEKHTIARJonathan
DEKHTIARJonathan / script.sql
Created November 22, 2016 12:10
Delete if exists table in Oracle
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE table_name';
EXCEPTION
WHEN OTHERS THEN NULL;
END;
/