Skip to content

Instantly share code, notes, and snippets.

View thedanielhanke's full-sized avatar

Daniel Hanke thedanielhanke

  • RE: GmbH
  • Cologne, Germany
View GitHub Profile
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@phortx
phortx / model.js
Last active May 3, 2020 22:27
Vuex-ORM model base class with convenience methods
import { Model as ORMModel } from '@vuex-orm/core';
/**
* Wrapper for models to provide model level convenience methods for interacting with the store and persistence.
* Will be built into vuex-orm in the future. See https://github.com/vuex-orm/vuex-orm/issues/60
*
* Requires the inflected npm package.
*/
export default class Model extends ORMModel {
/**
@denji
denji / nginx-tuning.md
Last active April 24, 2024 19:39
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.

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 23, 2024 19:14
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'