-
Collecting material: For a number of topics that I may write about in the future, I have text files where I collect information as I come across it during coding, on the web, on Twitter, etc.
-
Outline: The collected material is my starting point. I rearrange it into an outline which I refine until I’m happy with it. Refining includes adding/removing/rearranging items and doing more research when I notice gaps in my knowledge.
-
Skeletal draft: I add bullet points and code examples until almost all of the content exists at least in skeletal form. This process often uncovers knowledge gaps and flaws in the structure of the content which I then can fix.
const primaryColumn = document.querySelector('div[data-testid="primaryColumn"]'); | |
document.body.innerHTML = ''; | |
document.body.append(primaryColumn); | |
// Per-tweet controls | |
for (const ele of document.querySelectorAll('div[role="group"]')) { | |
ele.remove(); | |
} | |
// Reply widget |
// Batch-delete videos from YouTube’s “Watch later” playlist | |
// Paste the following code into a browser console while the playlist is open | |
// Code based on: https://gist.github.com/astamicu/eb351ce10451f1a51b71a1287d36880f?permalink_comment_id=4087416#gistcomment-4087416 | |
// | |
// (Suggestions for improvement welcome. My approach for waiting for the .click() to finish, feels hacky.) | |
const pause = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); | |
async function remove() { | |
for (let i=0; i < 100; i++) { | |
document.querySelector('#primary button[aria-label="Action menu"]').click(); |
import React from "react"; | |
import { gql } from "apollo-boost"; | |
import { Form,Dropdown } from "semantic-ui-react"; | |
import PhonePrefix from "PhonePrefix"; | |
//use graphql for api call | |
const COUNTRY_QUERY = gql` | |
{ | |
countries { | |
id |
This is a proposal for a lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal! If you're on your phone, please request the 🖥 desktop site to star this gist 😇 #ReactiveConf
/** | |
* When manually subscribing to an observable in a view component, developers are traditionally required | |
* to unsubscribe during ngOnDestroy. This utility method auto-configures and manages that relationship | |
* by watching the DOM with a MutationObserver and internally using the takeUntil RxJS operator. | |
* | |
* Angular 7 has stricter enforcements and throws errors with monkey-patching of view component life-cycle methods. | |
* Here is an updated version that uses MutationObserver to accomplish the same goal. | |
* | |
* @code | |
* |
The code here captures some of the patterns I used in the "real estate" demo app discussed in my talk End to End Apps with Polymer from Polymer Summit 2017.
There are many ways to connect Redux to custom elements, and this demonstrates just one pattern. The most important aspects are to try and lazily-load as much of the otherwise global state management logic along with the components that need them (as shown via the lazyReducerEnhancer
and addReducers
calls in the connected components), and to consider the tradeoffs you make in terms of coupling components to the store.
The pattern shown here of creating a stateless component and then a subclass that connects it to the store addresses a potential desire to reuse app-level stateless components between more than one application context, so the subclass provides a degree of decoupling from the concrete store, at the expense of more boilerplate. If app com
Find the instruction in the link below https://www.raspberrypi.org/documentation/installation/installing-images/README.md
$ sudo apt-get -y install lxde-core lxterminal lxappearance xinit lightdm ntfs-3g python-pexpect vim figlet git-core firmware-ralink hostapd isc-dhcp-server lighttpd samba samba-common-bin php5-common php5-cgi php5 php5-mysql screen fbi ttf-mscorefonts-installer mediainfo gparted php5-cli iptables xtightvncviewer imagemagick dosfstools exfat-utils exfat-fuse hfsplus hfsprogs hfsutils xdotool expect expect-dev avahi-daemon libavahi-compat-libdnssd-dev feh libjpeg8 libjpeg8-dev libao-dev avahi-utils libavahi-compat-libdnssd-dev libva-dev youtube-dl python-smbus mpg321 mpg123 libreoffice-impress rc-gui python-pip iceweasel python-dev python-dbus xpdf x11-xserver-utils libncurses5-dev shellinabox tk okular usbmount libgstreamer0.10-0 libgstreamer0.10-dev gstreamer0.10-tools gstr
# See list of docker virtual machines on the local box | |
$ docker-machine ls | |
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS | |
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1 | |
# Note the host URL 192.168.99.100 - it will be used later! | |
# Build an image from current folder under given image name | |
$ docker build -t gleb/demo-app . |
var wd = require('wd'); | |
// This is for Chromedriver directly. | |
// If you are using Selenium, use http://localhost:4444/wd/hub | |
var browser = wd.promiseRemote('http://localhost:9515'); | |
var URL = 'http://islreview.com/'; // Change this to a custom URL | |
var config = { | |
"browserName": "chrome", | |
"chromeOptions": { |