Skip to content

Instantly share code, notes, and snippets.

@agniswarm
agniswarm / c_cpp_properties.json
Last active July 20, 2018 18:12
The VS code config file for C++
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"C:/MinGW/**"
],
"defines": [
"_DEBUG",
@agniswarm
agniswarm / GitHelp.txt
Created July 21, 2018 19:13
Git Related Help
To undo Commits on github
1. Uncommit the commits using using VS Code
2. use this Cli Command 'git push origin +branchName'
@agniswarm
agniswarm / settings.json
Created July 28, 2018 20:18
Gist for VS code setting for typescript
{
"editor.formatOnSave": true,
"files.exclude": {
"*.js": true,
"*.js.map": true,
"ServerLocal": true
}
}
@agniswarm
agniswarm / openssl.txt
Created July 29, 2018 20:34
OPENSSL Commands
openssl genrsa -out ca.key 4096
openssl req -new -x509 -days 1826 -key ca.key -out ca.crt
openssl genrsa -out ia.key 4096
openssl req -new -key ia.key -out ia.csr
openssl x509 -req -days 730 -in ia.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out ia.crt
openssl pkcs12 -export -out ia.p12 -inkey ia.key -in ia.crt -chain -CAfile ca.crt
source : https://goo.gl/m2aW9p
@agniswarm
agniswarm / openssl.md
Created July 29, 2018 20:40 — forked from NoMan2000/openssl.md
Common OpenSSL Commands with Keys and Certificates

Common OpenSSL Commands with Keys and Certificates

SSL Info

Generate RSA private key with certificate in a single command

openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar

Generate Certificate Signing Request (CSR) from private key with passphrase

openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar

@agniswarm
agniswarm / isPrime.js
Created August 15, 2018 13:13
Prime Number
function isPrime(n) {
let counter = 0;
if (n == 2) return true;
if (n % 2 == 0 || n == 1) return false;
for (let i = 1; i <= n / 2; i += 2) {
if (n % i == 0)
counter++;
if (counter == 2)
break;
}
@agniswarm
agniswarm / request.js
Created September 22, 2018 08:01
Turn requestjs into a async and await style function
import request from 'request';
async function requested(params: any) {
let promise = await new Promise<any>((resolve, reject) => {
request(params, (err: any, res: any, body: any) => {
if (err || res.statusCode != 200)
reject(err)
else
resolve(body);
})
@agniswarm
agniswarm / .prettierrc
Created June 11, 2019 16:17
Linting with prettier and TSLint and husky
{
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 100,
"proseWrap": "always",
"quoteProps": "as-needed",
@agniswarm
agniswarm / jwtRS256.sh
Created November 16, 2019 13:04 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@agniswarm
agniswarm / docker-compose.yml
Last active December 25, 2019 18:10
Neo4j Docker
version: '3'
services:
graphdb:
image: neo4j
ports:
- 7474:7474
- 7687:7687
volumes:
- $HOME/neo4j/data:/data