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 main | |
import ( | |
"sync/atomic" | |
"time" | |
) | |
var sharedIntForAtomic int64 = 0 | |
var unusedValueForAtomic int = 0 |
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 multiprocessing | |
bind = '0.0.0.0:8000' | |
workers = multiprocessing.cpu_count() | |
worker_class = 'gevent' | |
accesslog = '/var/log/progam_name/gunicorn/access.log' | |
errorlog = '/var/log/progam_name/gunicorn/error.log' | |
loglevel = 'debug' | |
access_log_format = '[%(h)15s] (%(s)s) [%(D)8sms] %(r)s | %(b)sb' | |
proc_name = 'progam_name_gunicorn' |
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
#!/usr/bin/python | |
# | |
# Copyright 2017 Otto Seiskari | |
# Licensed under the Apache License, Version 2.0. | |
# See http://www.apache.org/licenses/LICENSE-2.0 for the full text. | |
# | |
# This file is based on | |
# https://github.com/swagger-api/swagger-ui/blob/4f1772f6544699bc748299bd65f7ae2112777abc/dist/index.html | |
# (Copyright 2017 SmartBear Software, Licensed under Apache 2.0) | |
# |
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
// tweaked from: https://stackoverflow.com/a/42718113/1170664 | |
func getXML(url string) ([]byte, error) { | |
resp, err := http.Get(url) | |
if err != nil { | |
return []byte{}, fmt.Errorf("GET error: %v", err) | |
} | |
defer resp.Body.Close() | |
if resp.StatusCode != http.StatusOK { | |
return []byte{}, fmt.Errorf("Status error: %v", resp.StatusCode) |
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
<?php | |
// This is code to return custom error message | |
// for Youtube tutorial: Laravel 5.4 Additional Login Conditions | |
// https://www.youtube.com/watch?v=Z8s6uhhD1Pk | |
namespace App\Http\Controllers\Auth; |
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
// A handy map of US state codes to full names | |
var usc = map[string]string{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", |