Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View AbdulRafay's full-sized avatar
🎯
Focusing

Rafay AbdulRafay

🎯
Focusing
View GitHub Profile
@AbdulRafay
AbdulRafay / hiddenmojo
Last active January 28, 2020 09:08
gather table cell values in last cell's form hidden field
jQuery('tr', jQuery(".ht-table").first().find('tbody')).each(function(i,j){
var last=jQuery(j).children().last().get(0);
var form=jQuery(last).find("form");
let l=jQuery("th,td",j);
var temp="<h3>"+jQuery(j).closest("div.single_toggle").find('p.toggler').text()+"</h3>";
jQuery(l).each((a,b)=>{
if(jQuery(b).children().length == 0){
temp += "<p>"+jQuery(j).closest("table").find("thead>tr>th:eq("+a+")").text()+": "+jQuery(b).text()+"</p></br>";
}
});
import requests
import json
# defining the api-endpoint
API_ENDPOINT = "https://entke6c4912e.x.pipedream.net"
predi = "{'data': 'awesome predication'}"
# data to be sent to api
data = json.dumps(predi)
import torch
import warnings
from pathlib import Path
from argparse import ArgumentParser
from pybert.train.losses import BCEWithLogLoss
from pybert.train.trainer import Trainer
from torch.utils.data import DataLoader
from pybert.io.bert_processor import BertProcessor
from pybert.common.tools import init_logger, logger
from pybert.common.tools import seed_everything
ambari-server stop
ambari-agent stop
pkill -9 java
#################################
# Remove Packages
################################
yum -y remove ambari-\*
yum -y remove hcatalog\*
yum -y remove hive\*
import random, string, urllib.request, json, getpass
#Generate root password
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
! unzip -qq -n ngrok-stable-linux-amd64.zip
#Setup sshd