Skip to content

Instantly share code, notes, and snippets.

View riteshgurung's full-sized avatar
🏠
Working from home

Ritesh Gurung riteshgurung

🏠
Working from home
View GitHub Profile
@riteshgurung
riteshgurung / AgileContractGuide.md
Created February 23, 2021 06:46 — forked from RobRuana/AgileContractGuide.md
Agile Contract Guide

Agile Contract Guide

This document is a guide to writing agile contracts. Unlike traditional contracts, an agile contract does not specify individual tasks to be completed by the Contractor. Rather, an agile contract specifies how the Client and Contractor interact, and how the Contractor is paid. The Deliverable Work performed for the contract is determined through an ongoing collaboration between the Client and the Contractor.

Agile contracts require a great deal of trust from both the Client and the Contractor. This trust is fostered through tight feedback cycles and well-defined responsibilities that both parties can expect from each other. More so than traditional contracts, an agile contract requires active participation from the Client.

@riteshgurung
riteshgurung / Jenkinsfile
Created February 4, 2021 13:23
Jenkinsfile for static analysis
node('docker') {
ansiColor('xterm') {
stage('Checkout') {
checkout scm
}
stage('Pulling') {
sh 'docker pull jakzal/phpqa'
}
@riteshgurung
riteshgurung / SonarDrupalKeyGenerator.php
Created September 24, 2020 02:55 — forked from geerlingguy/SonarDrupalKeyGenerator.php
A simple PHP script to generate the XML necessary for Sonar to detect the Drupal Coder module's sniffs. See: https://drupal.org/node/2082563
<?php
/**
* @file
* Generate rules for Drupal Coding Standards Sniffs.
*
* SonarQube requires manually-entered PHP CodeSniffer rules if you use anything
* outside of the standard set of rules. In this case, there are a bunch of
* Drupal-specific sniffs that we'd like to use.
*
@riteshgurung
riteshgurung / nginx-tuning.md
Last active August 27, 2020 06:50 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

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.

*apach2 + php-fpm profiling*
ps -ylC apache2 --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
ps -ylC php-fpm7.2 --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
@riteshgurung
riteshgurung / Makefile
Created January 3, 2020 16:31 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@riteshgurung
riteshgurung / react_samples_list.md
Created February 24, 2019 17:45 — forked from jpalala/react_samples_list.md
React Samples List

LOAD CSV into Neo4j quickly and successfully

Since version 2.1 Neo4j provides out-of-the box support for CSV ingestion. The LOAD CSV command that was added to the Cypher Query language is a versatile and powerful ETL tool. It allows you to ingest CSV data from any URL into a friendly parameter stream for your simple or complex graph update operation, that …​ conversion.

Before you start

Make sure you have python, OpenFace and dlib installed. You can either install them manually or use a preconfigured docker image that has everying already installed:

docker pull bamos/openface
docker run -p 9000:9000 -p 8000:8000 -t -i bamos/openface /bin/bash
cd /root/openface
@riteshgurung
riteshgurung / neo4j_cypher_cheatsheet.md
Created May 10, 2018 08:00 — forked from DaniSancas/neo4j_cypher_cheatsheet.md
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)