Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

iitsuraj

🏠
Working from home
View GitHub Profile
@iitsuraj
iitsuraj / install-synapse.sh
Last active Aug 16, 2020
How to Install Matrix Synapse Chat on Ubuntu 18.04 LTS
View install-synapse.sh
#!/bin/bash
echo updating...
apt-get -qq update
echo update completed.
echo upgrading...
apt-get -qq --yes upgrade
echo upgrade completed
echo Installing dev dependency
apt-get -qq --yes install build-essential python3-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libjpeg-dev libxslt1-dev
View rate-limit.js
var limiter = require("../misc/rate-limit.js")
app.post("/create-account", limiter.createAccountLimiter, function(req, res) {
//...
});
View express js Logger
const express = require("express");
const fs = require("fs");
const PORT = 5000;
const app = express();
const getActualRequestDurationInMilliseconds = start => {
const NS_PER_SEC = 1e9; // convert to nanoseconds
const NS_TO_MS = 1e6; // convert to milliseconds
const diff = process.hrtime(start);
@iitsuraj
iitsuraj / App.js
Created Feb 25, 2020
Redis demo for use
View App.js
const express = require('express');
const fetch = require('node-fetch');
const redis = require('redis');
const PORT = process.env.PORT || 5000;
const REDIS_PORT = process.env.PORT || 6379;
const client = redis.createClient(REDIS_PORT);
const app = express();
@iitsuraj
iitsuraj / LinedinEmailsScraper.js
Created Jan 14, 2020
Linkedin E-mail Scraper
View LinedinEmailsScraper.js
function extractEmails(text) {
return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi);
}
function randomIntFromInterval(min, max) {
// min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
}
function CommentProcess() {
if (
document.getElementById("show_prev") === null ||
View gist:d9e47a187d4e9d72d4f2d4cbb813716c
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["jquery","popper.js"],e):e(t.jQuery,t.Popper)}(this,function(t,e){"use strict";function n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function i(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}t=t&&t.hasOwnProperty("default")?t.default:t,e=e&&e.hasOwnProperty("default")?e.default:e;var s,a,l,c,h,u,d,f,p,m,g,_,v,y,E,b,C,I,T,A,S,w,D,N,O,k,$,j,R,L,P,x,F,M,Q,H,U,G,W,B,K,V,Y,q,z,X,Z,J,tt,et,nt,it,rt,ot,st,at,lt,ct,ht,ut,dt,ft,pt,mt,gt,_t,vt,yt,Et,bt,Ct,It,Tt
View Suraj_instagram_follow_bot
var count =0;
function follow(button, arrow) {
console.log(count);
button.click();
count++;
next(arrow)
}
function next(arrow) {
if (arrow == null) {
You can’t perform that action at this time.