Skip to content

Instantly share code, notes, and snippets.

View bulkan's full-sized avatar
🇯🇵

Savun Bulkan Evcimen bulkan

🇯🇵
View GitHub Profile

Flask + uWSGI + nginx Primer

I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

How this shit works

  • Flask is managed by uWSGI.
  • uWSGI talks to nginx.
@bulkan
bulkan / color_war.html
Created July 25, 2013 14:13
color wars - jenniferdewalt.com/color_war.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta property="og:image" content="http://jenniferdewalt.com/images/fb_icon.png"/>
<title>Color War | Jennifer Dewalt</title>
<link href="css/reset.css" rel="stylesheet">
<link href="css/color_war.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
# Copyright 2008-2013 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
// knockout 2.2.1
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
ko.utils.arrayForEach = function (array, action) { /* .. */ }
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ }
@bulkan
bulkan / date.md
Last active December 21, 2015 01:29
Date issues to work on
@bulkan
bulkan / highscore.js
Created August 26, 2013 05:52
goog.net.XhIo example GET request
goog.require('goog.net.XhrIo');
function get_highscore() {
var dataUrl = "http://httpbin.org/get";
goog.net.XhrIo.send(dataUrl, function(e) {
var xhr = e.target;
var obj = xhr.getResponseJson();
console.log(obj);
});
{
"audits": [
{
"id": 12801599053,
"ticket_id": 539,
"created_at": "2013-04-22T20:10:58Z",
"author_id": 240761622,
"via": {
"channel": "web",
"source": {
(function() {
return {
requests: {
/**
* Load a script file from the asset directory of the app
*
* @param asset String name of the JavaScript file to load
var ganttresult = [];
app.get('/get',cors(), function(request,response) {
async.waterfall([
function(callback) {
connection.query("SELECT id FROM Gantt",function(err, rows) {
if (err) return callback(err);
@bulkan
bulkan / sequelize.md
Last active January 14, 2024 05:48
Using Sequelize migrations with an existing database

Install

I'm sure you know know how to install packages but here is the command for the sake of completeness

npm install sequelize async

The first migration

First initilize the migrations structure