Skip to content

Instantly share code, notes, and snippets.

View SwadhInz's full-sized avatar
🎯
Focusing

Ridwanul Jauad SwadhIn SwadhInz

🎯
Focusing
View GitHub Profile
@SwadhInz
SwadhInz / ReadMe.md
Created January 26, 2021 23:52 — forked from edm00se/ReadMe.md
Sample nginx.conf settings to perform reverse proxy functionality to.

Read Me

In order to access a server hosted within a vm (guest), for development purposes from the host OS, which is restricted to same origin / localhost only requests, I set up a siple nginx reverse proxy to forward my requests.

Steps

  1. To install in a Windows VM, download and install nginx from the current, stable release; I installed to C:\nginx\
  2. Edit the <install path>/conf/nginx.conf file with the marked changes in the file of the same name in this gist.
  3. Start the nginx executable, located in your install path. There are service wrappers for Windows, or you can just kill the process to stop the nginx instance.

Commands for Windows

Modern Google Loader in Pure CSS ('-' * 32) Modern Google spinning loader animating through four colors.

A Pen by jczimm on CodePen.

License.

@SwadhInz
SwadhInz / parseAndModifyHtml.js
Created January 19, 2019 14:58 — forked from clarkdave/parseAndModifyHtml.js
Using node.js to parse HTML with jsdom and modify it with jQuery
/**
* npm install jsdom
* npm install jquery
*/
var html = "<!doctype html><html><body><h1>Hello world!</h1></body></html>";
/* parse the html and create a dom window */
var window = require('jsdom').jsdom(html, null, {
// standard options: disable loading other assets
@SwadhInz
SwadhInz / sql-mongo_comparison.md
Created January 14, 2019 15:01 — forked from aponxi/sql-mongo_comparison.md
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@SwadhInz
SwadhInz / mongoose-cheatsheet.md
Created January 13, 2019 07:29 — forked from subfuzion/mongoose-cheatsheet.md
mongoose cheatsheet

Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.

Install

$ npm install mongoose --save

Connect

const mongoose = require('mongoose');
@SwadhInz
SwadhInz / nginx-tuning.md
Created January 9, 2019 15:19 — 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.

#include <stdio.h>
int main()
{
int line, t, n, k, sum, i, j;
scanf("%d", &n);
for(line = 1; line <= n; line++) {
for(i = 0; i < (n - line); i++)
#include <stdio.h>
#include <string.h>
int main()
{
char txt[100], pat[100];
int k, i, plen, b;
gets(txt);
gets(pat);
#include <stdio.h>
int main()
{
char str[100], ch;
int i, k;
k = 0;
gets(str);
scanf("%c", &ch);
#include <stdio.h>
int main()
{
int n, k;
long long int f;
scanf("%d", &n);
f = 1;