Полезные ссылки изучающему анону
- Список рекомендаций с форчана:
- Ещё один список рекомендаций, на этот раз на русском языке:
- Лучший словарь для PC:
- Онлайн-словари:
- японо-русские:
/** | |
* Создание Web Worker-а без использования внешнего JS-файла. | |
* Работает ТОЛЬКО в Google Chrome (остальные браузеры не поддерживают BlobBuilder) | |
*/ | |
function InlineWorker(code) { | |
var URL = (self.URL || self.webkitURL), BlobBuilder = (self.BlobBuilder || self.WebKitBlobBuilder); | |
var bb = new BlobBuilder(); | |
bb.append("(" + code.toString() + ")();"); | |
var url = URL.createObjectURL(bb.getBlob("application/javascript")); | |
var worker = new Worker(url); |
### Locating UI elements ### | |
# By ID | |
<div id="coolestWidgetEvah">...</div> | |
element = driver.find_element_by_id("coolestWidgetEvah") | |
or | |
from selenium.webdriver.common.by import By | |
element = driver.find_element(by=By.ID, value="coolestWidgetEvah") | |
# By class name: |
<?php | |
/* | |
Update resource fields when they are saved | |
trigger on the following system events: | |
OnBeforeDocFormSave | |
OnDocFormSave | |
note: changing / inserting tv values is better done onDocFormSave as the process for saving tvs onBeforeDocFormSave is much more complicated (apparently) |
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
<?php | |
// Use this line to prevent people from hammering your server. | |
if (!isset($_GET['super_secret']) || ($_GET['super_secret'] != 'secretpassword')) return 'Not authorized'; | |
// Call this snippet uncached in a resource with template "empty": | |
// content: "[[!benchmark]]" | |
// Make sure to tag the resource as uncachable | |
// The intro | |
echo '<body style="font-family: sans-serif;">'; |
# Same as before, with a kivy-based UI | |
''' | |
Bluetooth/Pyjnius example | |
========================= | |
This was used to send some bytes to an arduino via bluetooth. | |
The app must have BLUETOOTH and BLUETOOTH_ADMIN permissions (well, i didn't | |
tested without BLUETOOTH_ADMIN, maybe it works.) |
<?php | |
$context = $modx->context->get('key'); | |
if ($context == 'mgr' || empty($_POST['quick_order']) || empty($_POST['id']) || empty($_POST['customer'])) { | |
return; | |
} | |
/** | |
* @var miniShop2 $miniShop2 | |
*/ | |
$miniShop2 = $modx->getService('minishop2'); | |
$miniShop2->initialize($context, array( |
Полезные ссылки изучающему анону