This file contains 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
// Start auto scroll | |
scroll=window.setInterval(function(){window.scrollTo(0,document.body.scrollHeight);},1000); | |
// Stop auto scroll | |
clearInterval(your_number_here); | |
// Stop all interval | |
function clearAllIntervals() { | |
for (var i = 1; i < 99999; i++) | |
window.clearInterval(i); |
This file contains 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
# Download YouTube playlist | |
yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" https://www.youtube.com/playlist?list=PL8gC7LBaclGRz6hq5QlkAa-8icPnvB3mV |
This file contains 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
List <Apexlog> loglist = [Select Id from Apexlog limit 100]; | |
for(Apexlog al: loglist){ | |
Http h = new Http(); | |
HttpRequest req = new HttpRequest(); | |
req.setEndpoint(Url.getOrgDomainUrl().toExternalForm() | |
+ '/services/data/v44.0/sobjects/Apexlog/'+al.Id); | |
req.setMethod('DELETE'); | |
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId()); | |
HttpResponse res = h.send(req); | |
System.debug(res.getStatusCode()); |
This file contains 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
TimeZone tz = UserInfo.getTimeZone(); | |
DateTime dt = Datetime.now(); | |
system.debug('Actual Time as String ' + dt.format()); | |
system.debug('Offset ' + tz.getOffset(dt)/1000); | |
system.debug('Formatted Time ' + dt.addSeconds((tz.getOffset(dt)/1000))); |
This file contains 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
Winter' 21: | |
- Safe Navigation Operator: | |
contactsByBadgeId.get(badBadgeId)?.FirstName; |
This file contains 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
@isTest | |
private class Permissions_Tests { | |
@testSetup | |
static void testSetup() { | |
Account a = TestFactory.getAccount('No view for you', true); | |
Private_Object__c po = new Private_Object__c(Account__c = a.Id, Notes__c = 'Foo'); | |
insert po; | |
} | |
@isTest |
This file contains 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
// download yt cover | |
youtube-dl --write-thumbnail --skip-download -v https://www.youtube.com/c/Username |
This file contains 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
// download best mp4 video from YouTube | |
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' |
This file contains 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
##### install node js ##### | |
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh | |
bash install_nvm.sh | |
source ~/.profile | |
nvm ls-remote | |
nvm install 8.11.1 | |
nvm use 8.11.1 |
This file contains 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
def get_signature(path, verb, token, timestamp, body=""): | |
""" | |
generate SHA256-HMAC python | |
""" | |
token = f"Bearer {token}" | |
CONSUMER_SECRET = "cY69Vx8dTPbLqTKW" | |
message = f"path={path}&verb={verb}&token={token}×tamp={timestamp}&body={body}" | |
print(message) | |
message = bytes(message, "utf-8") |
NewerOlder