Skip to content

Instantly share code, notes, and snippets.

View vikpande's full-sized avatar
🇳🇱
:-)

Vikas Pandey vikpande

🇳🇱
:-)
View GitHub Profile
@vikpande
vikpande / syntax_component
Created August 7, 2017 18:12
React snippets
class SayHello extends React.Component {
constructor(props) {
super(props);
this.state = {message: 'Hello!'};
// This line is important!
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
alert(this.state.message);
@vikpande
vikpande / API call and display
Last active October 24, 2017 18:03
calling an API
import React, { Component } from 'react';
import * as BooksAPI from './BooksAPI';
import ShelfComponent from './ShelfComponent';
class App extends Component {
state = {
books: []
}
componentDidMount(){
BooksAPI.getAll().then(booksfromServer=> this.setState({books:booksfromServer}))
@vikpande
vikpande / arrow functions
Last active October 24, 2017 18:02
JS commonly used commands
const race = '100m Dash';
const winners = ['Hunter Gath', 'Singa Song', 'Imda Bos'];
const win = winners.map((winner, i) => ({name: winner, race, place: i + 1}));
const ages = [23,62,45,234,2,62,234,62,34];
const old = ages.filter(age => age >= 60);
console.log(old);
const names = ['wes', 'kait', 'lux'];
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
Verifying my Blockstack ID is secured with the address 18XMQA5Tama91EXeRuYLnyuU5Jd6oTYXhw https://explorer.blockstack.org/address/18XMQA5Tama91EXeRuYLnyuU5Jd6oTYXhw
@vikpande
vikpande / DDD_2016_Rayner.md
Last active May 18, 2020 18:35
DDD talk summary by Paul Rayner
@vikpande
vikpande / ssl_cert_conversion_commands.md
Last active July 4, 2024 04:50
Convert SSL certificates to different formats & generate private key

Use below command to convert certificate format

  1. Convert .CRT to .PEM format
  • openssl x509 -inform der -in c:\Certificate\user2.crt (Your directory path) -out c:\Certificate\certificate_1.pem (Your directory path)
  1. Convert .CRT to .PFX format
  • openssl pkcs12 -export -out c:\Certificate\certificate.pfx -inkey c:\Certificate\certificate_1.pem -in c:\Certificate\user2.crt
  1. Convert .PEM to .DER format
  • openssl x509 -outform der -in c:\Certificate\certificatename.pem -out c:\Certificate\certificatename.der
@vikpande
vikpande / GDPR_Blockchain.md
Last active December 10, 2018 12:52
GDPR considerations for a Blockchain app (permission-less & public)

GDPR & blockchain for permission-less & public

3 main areas to address

  • Identification of the data controller & data processor
  • Annonymizing the personal data
  • Data subject can exercise certain data subject rights
    • For e.g. Erase data at certain point of time

Data controller or processor - activities ( roles of various participants )

  • Protocol developer (regular developer)
@vikpande
vikpande / neo4j workshop
Last active November 15, 2019 17:03
neo4j_workshop_amsterdam - Refactoring large graphs (Excerpt from the training)
On Neo4J Desktop browser console :
To connect to the graph
- Connect:play http://guides.neo4j.com/modeling_sandbox/05_refactoring_large_graphs.html
Steps:
- As our graph gets bigger in size it starts to become unfeasible to refactor the whole thing in one go. Instead we’ll have to update it in batches.
Manual batching
When batching we sacrifice the atomicity that we’d get if we did everything in one transaction. It’s therefore useful to make our refactoring queries idempotent in case we need to re-run them. We also need to decide which node we’re going to center the refactoring around.
@vikpande
vikpande / architecture-patterns.md
Last active April 30, 2021 10:14
Architecture patterns

| Topic | N Tier | Web-Queue-Worker | Microservices | Event-driven architecture