Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Sagar Jha sagarjhaa

🎯
Focusing
Block or report user

Report or block sagarjhaa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sagarjhaa
sagarjhaa / reactComponentTemplate.js
Last active May 2, 2019
React component template
View reactComponentTemplate.js
import React, { Component } from 'react';
import { connect } from 'react-redux';
class TemplateComponent extends Component {
constructor(props) {
super(props);
}
render() {
return (
@sagarjhaa
sagarjhaa / canvas_drawing.js
Created Apr 7, 2019
How to draw using canvas
View canvas_drawing.js
var mousePressed = false;
var lastX, lastY;
var ctx;
var li = [];
function Draw(x, y, isDown) {
if (isDown) {
ctx.beginPath();
ctx.strokeStyle = $('#selColor').val();
ctx.lineWidth = $('#selWidth').val();
You can’t perform that action at this time.