Skip to content

Instantly share code, notes, and snippets.

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

Vikas Pandey vikpande

🇳🇱
:-)
View GitHub Profile
@vikpande
vikpande / DDD_2016_Rayner.md
Last active May 18, 2020 18:35
DDD talk summary by Paul Rayner
Verifying my Blockstack ID is secured with the address 18XMQA5Tama91EXeRuYLnyuU5Jd6oTYXhw https://explorer.blockstack.org/address/18XMQA5Tama91EXeRuYLnyuU5Jd6oTYXhw
// 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',
@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'];
@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 / 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);