Shell Oil Company in its gas station offers loyalty program under name Shell ClubSmart. Members collect points which can be later used to get rewards. In 2020 they have offered a collection of die-cast car models under name Shell Motorsport. All models of the colletion are equipped with electrical motor. One of the models - Nissan Formula E Gen 2 Car - contains a battery that can be used to control a model remotely over Bluetooth. In some markets a battery with
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
import React, { useState, useEffect } from 'react' | |
import styled from 'styled-components' | |
import { useCanvas } from 'utils/hooks' | |
import debounce from 'lodash/debounce' | |
export default function Glow() { | |
const [ref, setRef] = useState<HTMLCanvasElement | null>(null) | |
const [boxes, setBoxes] = useState<Box[]>([]) | |
const [ctx, width, height] = useCanvas(ref) | |
const moving = useMouseMoving() |
По мотивам вопросов чатика react.js@telegram
Оффтоп: пожалуйста, не нужно в сотый раз объяснять уже набившую оскомину тему новичку, который задаст подобный вопрос. Просто поделитесь ссылкой на этот текст. С уважением, Андрей @XaveScor Звёздочка
Краткий ответ на этот вопрос, если вы не хотите разбираться детальнее:
- Если вы экспериментируете, то можете взять в качестве стейт-менеджера что угодно. Буквально. Опыт лишним не будет.
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
// Google Apps Script methods available to scripts | |
declare namespace google { | |
/** | |
* Methods available to Google Apps Script | |
*/ | |
namespace script { | |
interface IRun { | |
[serverSideFunction: string]: Function; | |
/** |
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
// Google Apps Script methods available to scripts | |
declare namespace google { | |
/** | |
* Methods available to Google Apps Script | |
*/ | |
namespace script { | |
interface IUrlLocation { | |
/** | |
* The string value of URL fragment after the # character, or an emptry string if no URL fragment is present |
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
// app/adapters/application.js | |
import DS from 'ember-data'; | |
export default DS.JSONAPIAdapter.extend({ | |
host: 'http://0.0.0.0:8888', | |
namespace: 'api', | |
buildURL(record, suffix) { | |
return this._super(record, suffix) + '?_format=api_json'; | |
}, |
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
// using ES6 Proxy to deal with methods of Promise'd objects. works for me in Edge though not Chrome somehow. | |
let handler = { | |
get: (target, prop) => function() { | |
if(target instanceof Promise) { | |
let args = arguments; | |
return target.then((o) => o[prop].apply(o, args)); | |
} else { | |
let value = target[prop]; | |
return typeof value == 'function' ? value.bind(target) : value; | |
} |
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
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
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
#!/usr/bin/env python3 | |
# Get your files that Gmail block. Warning message: | |
# "Anti-virus warning - 1 attachment contains a virus or blocked file. Downloading this attachment is disabled." | |
# Based on: https://spapas.github.io/2014/10/23/retrieve-gmail-blocked-attachments/ | |
# Instructions: | |
# Go to your emails, click the arrow button in the top right, "Show original", then "Download Original". | |
# Move the files to the same directory as this program, then run it. | |
import sys |
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
'use strict'; | |
/* | |
Instructions: | |
1 - Should execute 'npm run prepare' | |
before the very first run, it will install and symlink all dependencies. | |
2 - Choose between production 'npm start' and development 'npm run start-dev' modes | |
(watcher will run immediately after initial run). |
NewerOlder