Skip to content

Instantly share code, notes, and snippets.

View jarebear6expepjozn6rakjq5iczi3irqwphcvb's full-sized avatar
Set your status

jarebear6expepjozn6rakjq5iczi3irqwphcvbswgkahd6b6twnxxid jarebear6expepjozn6rakjq5iczi3irqwphcvb

Set your status
View GitHub Profile
<?php
// This file walks you through the most common features of PHP's SQLite3 API.
// The code is runnable in its entirety and results in an `analytics.sqlite` file.
// Create a new database, if the file doesn't exist and open it for reading/writing.
// The extension of the file is arbitrary.
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
// Errors are emitted as warnings by default, enable proper error handling.
<?php
/*
Plugin Name: Users in Database
Plugin URI:
Description: Puts users in the database
Version: 1.0
Author: Nick Bair
Author URI: https://github.com/njbair
*/
@jarebear6expepjozn6rakjq5iczi3irqwphcvb
jarebear6expepjozn6rakjq5iczi3irqwphcvb / plugin.php
Created June 8, 2023 15:53 — forked from ediathome/plugin.php
yourls-plugin-users-in-database.php - In connection with Auth Manager Plus
<?php
/*
Plugin Name: Users in Database
Plugin URI:
Description: Puts users in the database
Version: 1.0
Author: Nick Bair - revised by Martin Kolb
Author URI: https://github.com/njbair
Author URI: https://github.com/ediathome
*/
@jarebear6expepjozn6rakjq5iczi3irqwphcvb
jarebear6expepjozn6rakjq5iczi3irqwphcvb / .vimrc
Created March 15, 2023 16:44 — forked from lattera/.vimrc
vimrc for FreeBSD development
" Modeline and Notes {
" vim: set foldmarker={,} foldlevel=0 spell:
" }
" Basics {
set nocompatible " explicitly get out of vi-compatible mode
set noexrc " don't use local version of .(g)vimrc, .exrc
set background=dark " we plan to use a dark background
set cpoptions=aABceFsmq
" |||||||||
<?php
/*
参考自:
http://darklaunch.com/2010/09/01/http-status-codes-in-php-http-header-response-code-function
http://snipplr.com/view/68099/
*/
function HTTPStatus($num) {
$http = array(
@jarebear6expepjozn6rakjq5iczi3irqwphcvb
jarebear6expepjozn6rakjq5iczi3irqwphcvb / nginx.conf
Created May 6, 2020 05:22 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@jarebear6expepjozn6rakjq5iczi3irqwphcvb
jarebear6expepjozn6rakjq5iczi3irqwphcvb / nginx-tuning.md
Created May 6, 2020 05:21 — forked from denji/nginx-tuning.md
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.

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jarebear6expepjozn6rakjq5iczi3irqwphcvb
jarebear6expepjozn6rakjq5iczi3irqwphcvb / s3.sh
Created July 23, 2017 01:12 — forked from chrismdp/s3.sh
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@jarebear6expepjozn6rakjq5iczi3irqwphcvb
jarebear6expepjozn6rakjq5iczi3irqwphcvb / app\Http\Kernel.php
Last active September 8, 2018 00:05
SSL fix for Laravel 5.5 behind load balancer/proxy/Cloudflare et al.
<?php
// ...
protected $middleware = [
// ...
App\Http\Middleware\ValidProxies::class,
];
// ...