This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tail -n +1 file1.txt file2.txt file3.txt >> log.txt | |
#==> file1.txt <== | |
#<contents of file1.txt> | |
#==> file2.txt <== | |
#<contents of file2.txt> | |
#==> file3.txt <== | |
#<contents of file3.txt> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var el = document.elementFromPoint(500, 100); | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 1, 1, false, false, false, false, 0, null); | |
el.dispatchEvent(evt); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var today = new Date(); | |
alert(today); | |
var future_date = new Date('2017/1/20 13:03:35 GMT-0400'); | |
alert(future_date); | |
var difference = future_date.getTime() - today.getTime(); | |
var thirty_days = 3600 * 24 * 30 * 1000; | |
alert(difference < thirty_days); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh root@raspberrypi dd if=/dev/mmcblk0 | gzip -c > img.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var phone = '2125551212'; | |
// make 10 digit phone number pretty | |
phone = phone.replace(/[^\d]+/g, '') | |
.replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2-$3'); | |
// (212) 555 - 1212 | |
console.log(phone); | |
var inputPhone = "(212) 555 - 1212"; | |
var cleanPhone = inputPhone.replace(/\D/g,''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
s = socket.socket() | |
host = "0.0.0.0" # REPLACE with IP of server | |
port = 12345 | |
s.connect((host, port)) | |
s.send("foo") | |
s.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html > | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Contact Form</title> | |
<meta name="description" content="A multi column contact form for Bootstrap 4" /> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" /> | |
<style type="text/css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RUN from console in Chrome on a Google SERP page -> use &num=100 param in URL | |
var links = []; | |
for(i=0;i<=100;i++){ | |
if(document.evaluate('//*[@id="rso"]/div/div/div['+i+']/div/div/h3/a', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue){ | |
links.push({ | |
"url":document.evaluate('//*[@id="rso"]/div/div/div['+i+']/div/div/h3/a', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.href, | |
"title":document.evaluate('//*[@id="rso"]/div/div/div['+i+']/div/div/h3/a', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.innerHTML, | |
"description":document.evaluate('//*[@id="rso"]/div/div/div['+i+']/div/div/div/div/span', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.innerHTML | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Twitter URL | |
// document.querySelectorAll('.ProfileCard-avatarLink')[2].href | |
// Twitter Handle | |
// document.querySelectorAll('.ProfileCard-avatarLink')[2].href.replace("https://twitter.com/","") | |
// Twitter Name | |
// document.querySelectorAll('.ProfileNameTruncated-link')[3].innerHTML.trim() | |
// Twitter Profile Image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOGFILE="/home/pi/status.log" | |
MAILGUN_API_KEY="XXXXXXXX" | |
MAILGUN_DOMAIN="XXXXXX" | |
SENDER="XXXXXXX" | |
RECEPIENT="XXXXX" | |
SUBJECT="Server Down" | |
TEXT="Restarting Server..." | |
echolog() |