Skip to content

Instantly share code, notes, and snippets.

@lmchawla
lmchawla / infinite scroller
Last active June 13, 2018 07:08
infinitely scrolls
function show_more()
{
//if(!load)return;
var scroll = $(window).scrollTop();
$("body, html").animate({
scrollTop: $(document).height()
}, 0);
}
function fetch_more(){
// len=$('.browse_startups_table_row').length;
var load=true;
var fill=true;
function match_profile(text,type){
if(!type){
var arrayString = 'cto|Tech Co Founder|VP';}
if(type==1){arrayString='lead|head|cofounder|co-founder|vp|president|director|manager|chief|data|analyst|senior'}
if(type==2){arrayString='python|node|technical|technology|software|engineering'}
return text.match(new RegExp("\\b(" + arrayString + ")\\b",'i'));
}
var template = "I would like to apply for Tech Lead role in your organization, \n I love your mission statement and I believe that I match the requirements. \nI have worked in multiple startups from planning, to product development. Hiring and leading teams. Raising rounds and completing successful exits and so I believe I will be a right fit for this role. \nMost recently, I worked extensively in analytics dashboards to optimise military decisions in BSF(border security force) and NSG(national security guards) \nI am attaching my resume for your reference \nhttps://goo.gl/6LfA8s \nMy contact number is 9899696089, would love to talk
var print = null;
var timers_added_today = 0;
moving_sum = 0;
looming_sum = 0;
var today = new Date();
var key = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();
var infolog = function () {
//console.log
}
function curr_hours() {
@lmchawla
lmchawla / delete_old.js
Last active October 25, 2018 15:27
Delete old facebook pending posts
function clickok(){lls=document.getElementsByClassName('_42ft _4jy0 layerCancel uiOverlayButton _4jy3 _4jy1 selected _51sy')
for(var i=0;i<lls.length;i++){
if(lls[i].textContent=="OK"){
lls[i].click();
}
}}
function delete1(){
clickok();
@lmchawla
lmchawla / form parser
Last active April 6, 2018 06:23
Parse forms into django
a=$('input');
var output='';
for(var i=0;i<a.length;i++){
if($(a[i]).attr("type")=="text"){var prev=$(a[i]).closest('td').prev('td');
if(prev.text().trim()==':')
{prev=prev.closest('td').prev('td');}
txt=prev.text().trim();
req=false;
if(txt.substring(txt.length-1, txt.length)=="*"){
req=true;
@lmchawla
lmchawla / InternetScreamer.py
Last active March 30, 2018 04:58
Screamer for mac, keep working while it informs when internet is down and back online. Accommodates sensitivity for erratic connections
import os
import time
working = 0
while True:
response = os.system("ping -c 1 8.8.8.8")
print(response, working)
if response == 0:
working = max(1, working + 1)
time.sleep(5)
var a=db.templates.find();
a.forEach(function(v){v.invite_templates.email.content = v.invite_templates.email.content.replace("Hi, {{recipient's name}}", "Hi {{recipient's name}},");db.templates.save(v);})
var a=db.templates.find();
a.forEach(function(v){print(v.invite_templates.email.content);})