Skip to content

Instantly share code, notes, and snippets.

View abhilashsajeev's full-sized avatar

Abhilash A S abhilashsajeev

View GitHub Profile
@abhilashsajeev
abhilashsajeev / index.js
Created June 5, 2023 09:55
pdfannotations
import PDFJSAnnotate from "../";
import initColorPicker from "./shared/initColorPicker";
function htmlEscape(text) {
return text
.replace("&", "&")
.replace(">", ">")
.replace("<", "&lt;")
.replace('"', "&quot;")
.replace("'", "&#39;");
@abhilashsajeev
abhilashsajeev / pdf_compression.go
Created January 20, 2023 12:21
pdf_compresson
package main
import (
"fmt"
pdfcpu "github.com/pdfcpu/pdfcpu"
api "github.com/pdfcpu/pdfcpu/pkg/api"
)
func main() {
inputPath := "input.pdf"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Highcourt of kerala</title>
<style>
body {
background-image: url("hc.jpg");
@abhilashsajeev
abhilashsajeev / main.go
Created January 17, 2022 10:58
Simple File Server using golang
package main
import (
"log"
"fmt"
"os"
"path/filepath"
"net/http"
"github.com/gin-gonic/gin"
)
@abhilashsajeev
abhilashsajeev / canvas.html
Created December 22, 2021 05:50
CANVAS draw text and identify
<html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tesseract.js/2.1.5/tesseract.min.js" integrity="sha512-QMGuBW4cKAKmxjxukfPlQqFL8Tc2yYWTBhg9o8fKx06BGZrNXMmafjtnmXthGasytcaIILHRrg5N5Hw0yOuSjw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript">
var canvas, ctx, flag = false,
prevX = 0,
currX = 0,
prevY = 0,
currY = 0,
dot_flag = false;
@abhilashsajeev
abhilashsajeev / download-google-drive-pdf.js
Created December 1, 2021 05:28
Download View only PDF File from Google Drive(Load The FIle Completely Before you console this)!!
let jspdf = document.createElement("script");
jspdf.onload = function () {
let pdf = new jsPDF();
let elements = document.getElementsByTagName("img");
for (let i in elements) {
let img = elements[i];
console.log("add img ", img);
if (!/^blob:/.test(img.src)) {
@abhilashsajeev
abhilashsajeev / pairsum.js
Created May 15, 2017 10:13
Solution to Array pair sum problem in JavaScript
var pairSum = (arr, k)=>{
if(arr.length < 2){
return
}
// sets for tracting
let seen = new Set();
let output = new Set();
for (let num of arr){
@abhilashsajeev
abhilashsajeev / index.js
Last active May 9, 2017 10:50
Need create new deployment function
'use strict';
//Import required modules
var AWS = require('aws-sdk'),
async = require('async'),
logger = require('winston'),
zip = require('node-zip')(),
ebzip = require('node-zip')(),
cfgManager = require('./config'),
s3Config = cfgManager.getConfig('s3'),
class Count extends React.Component {
constructor(){
this.state = {
count: 0
}
}
handleOnClick = ()=>{
let count = this.state.count + 1;
this.setState({count: count})
class Count extends React.Component {
constructor(){
this.state = {
count: 0
}
}
handleOnClick = ()=>{
let count = this.state.count + 1;
this.setState({count: count})