Skip to content

Instantly share code, notes, and snippets.

Pawan Bishnoi Pawan-Bishnoi

Block or report user

Report or block Pawan-Bishnoi

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
@Pawan-Bishnoi
Pawan-Bishnoi / core.js
Created Nov 10, 2017
FabricJS := Send real time data of free hand drawing to remote users
View core.js
/*
* We keep two canvases to mimic remote user behaviour
* Events from canvas_left should also reach canvas_right
*/
var canvas_left = new fabric.Canvas ('canvas1');
var canvas_right = new fabric.Canvas ('canvas2');
// is_down := keeps track if the mouse is down
// to distinguish mousemove and mousedrag
@Pawan-Bishnoi
Pawan-Bishnoi / longest_pali_string.cpp
Last active Aug 14, 2017
FInding longest palindromic substring using DP. Complexity : O(n^2) Space complexity: O(n^2)
View longest_pali_string.cpp
/*
* Longest palindromic string
* This is 0n^2 complexity
* space complexity is also 0n^2
* Although a solution with 0n^2 with constant space is also possible */
string longestPalindrome(char *A) {
int **table;
int n = A.length();
int i, j, len;
@Pawan-Bishnoi
Pawan-Bishnoi / paperjs-textarea.js
Created Mar 20, 2017
Emulating text tool with paperjs pointText and an HTML textarea element
View paperjs-textarea.js
/**
* Add an textarea, this is to be used as 'the editor'
* We will place it over some pointText that we want to edit
**/
var $anchor = $('body');
$anchor.append ('<textarea class="text-box" maxlength="50"' +
' style="position: absolute; color: black; display:none" type="text">' +
'</textarea>'); // hidden initially
var editor = $anchor.find ('.text-box');
You can’t perform that action at this time.