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
javascript:void function(){function truncateString(e,t){return e.length>t?e.slice(0,t):e}const title=document.title,href=location.href,host=new URL(href).host,cleanHost=host.replace(/[^a-zA-Z0-9]/g,"-");let finalHost=cleanHost.replace(/--/g,"-");finalHost.length||(finalHost="local");let sel=window.getSelection().toString();0===sel.length&&(sel=prompt("Description"));let text=`## ${title}\n\n${href}${sel&&sel.length>0?`\n\n${sel}`:""}`;const textarea=document.createElement("textarea");textarea.value=text,document.body.appendChild(textarea),textarea.select(),document.execCommand("copy");let command=`obsidian://advanced-uri?filepath=__INBOX/${finalHost}&mode=new`;if(document.queryCommandSupported("copy")){const e=document.execCommand("copy");document.body.removeChild(textarea),e?(console.log("Текст успешно скопирован в буфер обмена"),command=`obsidian://advanced-uri?filepath=__INBOX/${finalHost}&clipboard=true&mode=new`):(console.error("Перенос через URL"),command=truncateString(`${command}&data=${text=encodeURI |
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
script.dataset.ednaWidget = null; | |
// установит значение data-edna-widget="null" у элемента script |
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() { | |
for (var ssi = 0; ssi < document.styleSheets.length; ssi++) { | |
let rules; | |
try { | |
rules = document.styleSheets[ssi].cssRules || []; | |
} catch (e) { | |
rules = [] | |
} | |
var sheetHref = document.styleSheets[ssi].href || 'inline'; |
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
""" | |
pip install rtmidi | |
http://zabaykin.ru/?p=200 | |
""" | |
import time | |
import rtmidi | |
import win32api | |
#import win32clipboard |
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
> parseInt(1000) | |
1000 | |
> parseInt(1000.0) | |
1000 | |
> parseInt("1000.0") | |
1000 | |
> parseInt(1e3) |
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
const prev = oldVersion.split('.').map(Number); | |
const next = newVersion.split('.').map(Number); |
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
// get length of biggest nested array | |
const maxLength = Math.max(...sheetsArray.map(subArr => subArr.length)); |
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
const dtNow = new Date(); | |
const intTZOffset = dtNow.getTimezoneOffset() * 60000; // automatically adjust for user timezone | |
const intNow = dtNow.getTime() - intTZOffset; | |
const intDay = Math.floor(intNow / 86400000); // The number of 'local' days since Jan 1, 1970 | |
const randomIndex = intDay % QuotesData.length; | |
const item = QuotesData[randomIndex]; |
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
def get_page(url): | |
ua = r'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.50 Safari/537.36' | |
exe = r'C:\Program Files\Google\Chrome\Application\chrome.exe' | |
args = f'"{exe}" --headless --disable-gpu --dump-dom --user-agent="{ua}" "{url}"' | |
sp = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
out, err = sp.communicate() | |
print(err, 'error') if err else None | |
return out.decode('utf-8') if out else '' |
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
console.log('%c[MESSAGES.SCHEDULE at ]', 'color: blue;font-weight:bold') |
NewerOlder