Skip to content

Instantly share code, notes, and snippets.

View doctorallen's full-sized avatar

David Allen doctorallen

View GitHub Profile
@michaelmcshinsky
michaelmcshinsky / api-core.js
Last active December 8, 2023 13:51
A comprehensive starter solution to making API calls structured and manageable in code architecture and development teams.
import apiProvider from './provider';
export class ApiCore {
constructor(options) {
if (options.getAll) {
this.getAll = () => {
return apiProvider.getAll(options.url);
};
}
@fideloper
fideloper / stream_file.php
Last active January 17, 2024 18:41
Stream file from S3 to browser, assume Laravel Filesystem usage
<?php
/*************************************************************************
* Get File Information
*/
// Assuming these come from some data source in your app
$s3FileKey = 's3/key/path/to/file.ext';
$fileName = 'file.ext';
@jlem
jlem / ApplicationsServiceProvider.php
Created August 21, 2015 14:35
Laravel 5 App Skeleton
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Request;
use View;
use App;
abstract class ApplicationsServiceProvider extends ServiceProvider
{
public function register()
anonymous
anonymous / Clickthrough Splash
Created December 5, 2014 02:00
<html>
<head>
<title>Welcome to Public WiFi</title>
</head>
<body>
<h1>Welcome to Public WiFi</h1>
<?php
$base_grant_url = urldecode($_GET['base_grant_url']);
$user_continue_url = urldecode($_GET['user_continue_url']);
@mgmilcher
mgmilcher / gist:5eaed7714d031a12ed97
Last active March 28, 2023 14:53
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@denji
denji / nginx-tuning.md
Last active May 1, 2024 22:58
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.