TLDR: Use for...of instead of forEach() in asynchronous code.
For legacy browsers, use for(...;...;...) or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
| //manual watchdog pinging mode is dangerous for Espruino Web IDE upload with 'reset() before upload' enabled | |
| //you can brick your device with partial upload caused by watchdog reboot in the middle of upload | |
| //E.enableWatchdog(6, false); | |
| //var wdint=setInterval(function(){if(!BTN1.read())E.kickWatchdog();},1000); | |
| var log=console.log; | |
| Modules.addCached("HX03WLCD",function(){ | |
| // commands sent when initialising the display | |
| var initCmds = new Uint8Array([ | |
| 0xAE, // 0 disp off | |
| 0xD5, // 1 clk div |
| first console: | |
| pi@raspberrypi:~ $ sudo openocd -d2 -f interface/stlink.cfg -f target/nrf52.cfg | |
| Open On-Chip Debugger 0.10.0+dev-00637-gb3ed97a4 (2019-01-03-22:45) | |
| Licensed under GNU GPL v2 | |
| For bug reports, read | |
| http://openocd.org/doc/doxygen/bugs.html | |
| debug_level: 2 | |
| Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'. | |
| Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD |
| /* | |
| Also, need to change in ILI9341pal.js: | |
| var LCD_WIDTH = 320; | |
| var LCD_HEIGHT = 240; | |
| */ | |
| BTN1 = D39 | |
| BTN2 = D38 | |
| BTN3 = D37 | |
| SPKR = D25 |
I have been struggling to start a new project with Phoenix 1.3 and the new vue-cli 3 for Vue.js. There are tons of example already but none of them suited my needs, because:
Assuming that you have Elixir and Phoenix 1.3 are both installed, let's build our new App.
| # perform a fresh install of Ubuntu 17.10 | |
| # upgrade the kernel to v4.13.10 | |
| mkdir ~/kernel-v4.13.10 | |
| cd ~/kernel-v4.13.10 | |
| wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310_4.13.10-041310.201710270531_all.deb | |
| wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb | |
| wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-image-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb | |
| sudo dpkg -i *.deb |
| # -*- coding: utf-8 -*- | |
| # Scribd Ripper 1.0 | |
| # chocolatkey 2017 | |
| import requests | |
| import re | |
| import http.cookiejar | |
| import sys | |
| import time | |
| from bs4 import BeautifulSoup |
| #!/bin/sh | |
| # SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <sanderthedragon@zoho.com> | |
| # | |
| # SPDX-License-Identifier: MIT | |
| arch=$(dpkg --print-architecture) | |
| echo "Detected architecture: $arch" | |
| case "$arch" in |
| require 'sidekiq/api' | |
| # 1. Clear retry set | |
| Sidekiq::RetrySet.new.clear | |
| # 2. Clear scheduled jobs | |
| Sidekiq::ScheduledSet.new.clear |