Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
【Bootstrap】ヘッダーをレスポンシブに横スクロール対応 |
https://qiita.com/vaza__ta/items/921b748df585bbbb4300
|
bootstrap |
2022-08-13 02:38:42 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
【Bootstrap】ヘッダーをレスポンシブに横スクロール対応 |
https://qiita.com/vaza__ta/items/921b748df585bbbb4300
|
bootstrap |
2022-08-13 02:38:42 |
海外TECH |
DEV Community |
Build your «Smart device» for Google Home |
https://dev.to/davidnadejdin/build-your-for-google-home-2b2a
|
Build your «Smart device»for Google Home Creating Google Home projectWe will use Cloud to cloud integration method So we need to navigate to Actions on Google console and create a new project And we need to name our Smart Home Action Set up OAuth and backend serverCloud to cloud integration required OAuth server for linking your smart device service to Google Home application In this article we will implement it with Laravel framework and Passport package You should pass base steps like Laravel and Passport installation database setup and make fake users or you can find example code here All additional actions will be described next Account linkingMove to your Laravel project and run the command to generate OAuth Client Information for Google Home php artisan passport clientWhich user ID should the client be assigned to gt What should we name the client gt GoogleWhere should we redirect the request after authorization gt your project id New client created successfully Client ID b b a a baClient secret PEwdTAqkfvRXuyddJEaSzAIZGDWjIyRMPass received data and oauth endpoints to Account Linking settings in your project Implement backendTo notify Google Home about our device status we need to return their data when Google Home requested data by Fulfillment URL Google Home sends data in types SYNC QUERY and EXECUTE Response for sync request will return a list of all devices and their capabilities Request example requestId ffacc ec e ba abcf inputs intent action devices SYNC Response example requestId payload agentUserId user devices id type action devices types THERMOSTAT traits action devices traits TemperatureSetting name name Thermostat willReportState true attributes availableThermostatModes off heat cool thermostatTemperatureRange minThresholdCelsius maxThresholdCelsius thermostatTemperatureUnit C deviceInfo manufacturer smart home inc Resposne for query request must include a full set of states for each of the traits supported by the requested devices Request example requestId ffacc ec e ba abcf inputs intent action devices QUERY payload devices id Response example requestId payload agentUserId user devices status SUCCESS online true thermostatMode cool thermostatTemperatureSetpoint thermostatTemperatureAmbient thermostatHumidityAmbient Execute request contain data as same as Query but can contain commands given to a group of devices response is same as Query request example inputs context locale country US locale language en intent action devices EXECUTE payload commands devices id execution command action devices commands ThermostatTemperatureSetpoint params thermostatTemperatureSetpoint requestId Understanding device objectA device object on Sync request must contain information about a device like its name device info including traits and attributes based on included trains Device object on sync request id type action devices types THERMOSTAT traits action devices traits TemperatureSetting name name Thermostat willReportState true attributes availableThermostatModes off heat cool thermostatTemperatureRange minThresholdCelsius maxThresholdCelsius thermostatTemperatureUnit C deviceInfo manufacturer smart home inc And must contain a device state on Quest or Execute Device object on Query or Execute request status SUCCESS online true thermostatMode cool thermostatTemperatureSetpoint thermostatTemperatureAmbient thermostatHumidityAmbient Return and save device stateMove to your Laravel project and create a Thermostat model php artisan make model Thermostat m database migrations create thermostats table php lt phpuse Illuminate Database Migrations Migration use Illuminate Database Schema Blueprint use Illuminate Support Facades Schema return new class extends Migration public function up Schema create thermostats function Blueprint table table gt id table gt boolean online gt default false table gt string mode table gt unsignedInteger current temperature gt default table gt unsignedInteger expected temperature gt default table gt unsignedInteger humidity gt default table gt timestamps public function down Schema dropIfExists thermostats app Models Thermostate php lt phpnamespace App Models use Illuminate Database Eloquent Model class Thermostat extends Model protected fillable online mode current temperature expected temperature humidity protected casts online gt boolean php artisan migrate Implement Fulfillment URL route routes api php lt phpuse App Http Controllers FulfillmentController use Illuminate Support Facades Route Route post FulfillmentController class lt phpnamespace App Http Controllers use App Models Thermostat use Illuminate Http Request use Illuminate Support Arr class FulfillmentController extends Controller public function invoke Request request response null Extract request type switch request gt input inputs intent case action devices QUERY response this gt queryResponse break case action devices SYNC response this gt syncRequest break case action devices EXECUTE response this gt syncExecute this gt syncExecute request gt input inputs payload commands Extract list of commands break return response private function queryResponse devices Extract our devices states foreach Thermostat all as thermostat devices thermostat gt id status gt SUCCESS online gt thermostat gt online thermostatMode gt thermostat gt mode thermostatTemperatureSetpoint gt thermostat gt expected temperature thermostatTemperatureAmbient gt thermostat gt current temperature thermostatHumidityAmbient gt thermostat gt humidity return response requestId gt payload gt agentUserId gt user devices gt devices private function syncRequest devices Define our devices foreach Thermostat all as thermostat devices id gt thermostat gt id type gt action devices types THERMOSTAT traits gt action devices traits TemperatureSetting name gt name gt Thermostat willReportState gt true attributes gt availableThermostatModes gt off heat cool thermostatTemperatureRange gt minThresholdCelsius gt maxThresholdCelsius gt thermostatTemperatureUnit gt C deviceInfo gt manufacturer gt smart home inc return response requestId gt payload gt agentUserId gt user devices gt devices private function syncExecute array commands foreach commands as command Get devices for execute command thermostats Thermostat whereIn id Arr pluck command devices id gt get foreach command execution as executionItem switch executionItem command Handle set point command and save it in our model case action devices commands ThermostatTemperatureSetpoint foreach thermostats as thermostat thermostat gt update expected temperature gt executionItem params thermostatTemperatureSetpoint break Handle set set mode command and save it in our model case action devices commands ThermostatSetMode foreach thermostats as thermostat thermostat gt update mode gt executionItem params thermostatMode break It not necessary to return data for command request return response Return to Console actions and set your Fulfillment URL in your project settings And create your device in your database Simplify the authentication process Since we are not interested in authentication details we can skip the implement login page and force the authenticated user app Providers AppServiceProvider php lt phpnamespace App Providers use App Models User use Illuminate Support Facades Auth use Illuminate Support ServiceProvider class AppServiceProvider extends ServiceProvider public function register public function boot Auth setUser User first Link backend with Google HomeAfter previous actions you can test your backend with Google Home app which is authenticated as the same account used for creating Actions Console project After linking your device will appear in Google Home Now you can control your device and its state will be saved on the database You can trigger sync reconnect account query swipe update gesture and execute try to change mode You can find more about available device types and traits Here |
2022-08-12 17:21:05 |
海外TECH |
Engadget |
Peloton is jacking up prices of its Bike+ and Tread fitness gear again |
https://www.engadget.com/peloton-bike-tread-price-increase-layoffs-stores-outsourcing-173804988.html?src=rss
|
Peloton is jacking up prices of its Bike and Tread fitness gear againIt s been a brutal year for Peloton and the company is enacting more major changes in a bid to get back on track On the consumer front Peloton is reversing price cuts to two of its core pieces of fitness equipment The Bike is going back up from to in the US The Tread meanwhile will be more expensive than before Peloton reduced prices in April to focus on subscription revenues The Tread will go up by in the US to At the start of this year the machine cost The company is also increasing the prices of the products in Canada the UK Germany and Australia Lowering the prices in the first place “cheapened at least the perception of the brand CEO Barry McCarthy told Bloomberg “So this is a return to historical positioning He added that quot I probably wouldn t have messed with the prices at all if I had been confronted with different inventory states back when we lowered the pricing The company isn t changing the price of the original Bike or the Peloton Guide system for now Meanwhile in its third publicly disclosed round of layoffs this year Peloton is cutting another jobs across its distribution and customer service teams It will close warehouses in North America and solely use third party companies for deliveries and setting up equipment in people s homes Shutting down in house distribution and closing warehouses will lead to the loss of jobs The company will also use third parties to augment its customer support team which will be slashed roughly in half with the loss of positions Those job cuts are on top of around employees Peloton laid off in Taiwan last month as it transitions away from in house manufacturing In February Peloton culled around jobs and brought in McCarthy as the new CEO However the company still plans to hire in certain areas such as software development On top of all of that Peloton plans to start closing its retail showrooms next year It remains to be seen how many will be closed though it operates in the US and Canada The company will require office based workers to return to its offices as of November McCarthy told employees in a memo which was provided to Bloomberg that changes were necessary to help make the company cash flow positive once more “We have to make our revenues stop shrinking and start growing again he wrote “Cash is oxygen Oxygen is life Peloton posted a huge loss of million for the first three months of due to a decline in revenue and soaring operating costs It saw a major boom in business soon after the onset of the COVID pandemic However it believed that demand would continue after the planet opened back up and it built too many units of its fitness gear before slowing down production earlier this year nbsp We ll soon have a clearer picture of the current state of the business Peloton will post its earnings results for the April June quarter Q of its fiscal year on August th |
2022-08-12 17:38:04 |
海外TECH |
CodeProject Latest Articles |
Working with Newtonsoft.Json in C# & VB |
https://www.codeproject.com/Articles/1201466/Working-with-Newtonsoft-Json-in-Csharp-VB
|
converters |
2022-08-12 18:00:00 |
海外科学 |
NYT > Science |
What Happens If Shelling Continues at Zaporizhzhia Nuclear Plant? |
https://www.nytimes.com/2022/08/12/world/ukraine-zaporizhzhia-nuclear-plant.html
|
accident |
2022-08-12 17:55:35 |
海外科学 |
NYT > Science |
People Exposed to Covid May Need to Take as Many as Three At-Home Tests, F.D.A. Says |
https://www.nytimes.com/2022/08/12/health/covid-testing-fda.html
|
false |
2022-08-12 17:40:14 |
海外科学 |
NYT > Science |
Drought Is Declared in Parts of a Hot, Dry Britain |
https://www.nytimes.com/2022/08/12/world/europe/uk-heat-wave-drought.html
|
Drought Is Declared in Parts of a Hot Dry BritainThe announcement by the government will allow water companies to tighten conservation measures Extreme heat warnings have also been issued for parts of southern England and Wales |
2022-08-12 17:11:03 |
海外科学 |
NYT > Science |
How to View the Last Supermoon of the Year |
https://www.nytimes.com/2022/08/11/science/sturgeon-supermoon.html
|
night |
2022-08-12 17:57:16 |
海外TECH |
WIRED |
Here’s What Trump’s ‘Nuclear Documents’ Could Be |
https://www.wired.com/story/nuclear-documents-us-classification-system/
|
documents |
2022-08-12 17:55:28 |
ニュース |
BBC News - Home |
Salman Rushdie: Man arrested after author attacked on stage |
https://www.bbc.co.uk/news/world-us-canada-62524922?at_medium=RSS&at_campaign=KARANGA
|
satanic |
2022-08-12 17:33:06 |
ニュース |
BBC News - Home |
Who is Salman Rushdie? The writer who emerged from hiding |
https://www.bbc.co.uk/news/entertainment-arts-62523259?at_medium=RSS&at_campaign=KARANGA
|
onwards |
2022-08-12 17:02:40 |
ニュース |
BBC News - Home |
UK Heatwave: Official drought declared across large parts of England |
https://www.bbc.co.uk/news/uk-62508521?at_medium=RSS&at_campaign=KARANGA
|
water |
2022-08-12 17:19:30 |
ニュース |
BBC News - Home |
Women's Ballon d'Or: England's Millie Bright, Beth Mead and Lucy Bronze nominated for 2022 prize |
https://www.bbc.co.uk/sport/football/62524512?at_medium=RSS&at_campaign=KARANGA
|
Women x s Ballon d x Or England x s Millie Bright Beth Mead and Lucy Bronze nominated for prizeEngland Euro winners Millie Bright Beth Mead and Lucy Bronze are nominated for the women s Ballon d Or |
2022-08-12 17:54:29 |
ニュース |
BBC News - Home |
European Championships: Watch Jessica Roberts win silver in the 10k scratch race |
https://www.bbc.co.uk/sport/av/cycling/62525523?at_medium=RSS&at_campaign=KARANGA
|
European Championships Watch Jessica Roberts win silver in the k scratch raceWatch Great Britain s Jessica Roberts win silver in the k scratch race after a bold bid for victory at the European Championships |
2022-08-12 17:35:05 |
ニュース |
BBC News - Home |
How to protect your skin in the heat |
https://www.bbc.co.uk/news/uk-62525197?at_medium=RSS&at_campaign=KARANGA
|
adeline |
2022-08-12 17:04:06 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【避けたほうがいい人の特徴】関わるだけで面倒な人から、できるだけ角を立てずに逃げる方法 - とても傷つきやすい人が無神経な人に悩まされずに生きる方法 |
https://diamond.jp/articles/-/307702
|
|
2022-08-13 02:50:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【精神科医が教える】何度も同じミスを繰り返してしまう…。わざと自分を失敗させる「無意識」の恐るべき作用とは? - こころの葛藤はすべて私の味方だ。 |
https://diamond.jp/articles/-/307854
|
精神科医 |
2022-08-13 02:45:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【NHK『100分de名著』で話題】「生命とは何か?」の3つの根本的な回答 - WHAT IS LIFE?(ホワット・イズ・ライフ?)生命とは何か |
https://diamond.jp/articles/-/307723
|
」、さらには、ブライアン・コックス、シッダールタ・ムカジー、アリス・ロバーツなど、世界の第一人者から絶賛されている、ノーベル賞生物学者ポール・ナースの初の著書『WHATISLIFEホワット・イズ・ライフ生命とは何か』。 |
2022-08-13 02:40:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「守」と「攻」と「絆」で親の財産を守りなさい - 40代からは「稼ぎ口」を2つにしなさい |
https://diamond.jp/articles/-/307792
|
「守」と「攻」と「絆」で親の財産を守りなさい代からは「稼ぎ口」をつにしなさい「このまま」今の仕事を続けても大丈夫なのかあるいは「副業」をしたほうがいいのかそれとも「起業」か、「転職」をすべきなのかこのように感じたとしたら、それは皆さんの考えが正しい。 |
2022-08-13 02:35:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【子どもの好奇心を伸ばす】「絶滅」を学ぶと、世界の見え方が変わる3つの理由 - だから、この本。 |
https://diamond.jp/articles/-/307961
|
子どもがYouTubeやゲームに夢中になる時間が長くなり、自宅学習の在り方に悩む方も多いのでは。 |
2022-08-13 02:30:00 |
海外TECH |
reddit |
SK Gaming vs. Team Vitality / LEC 2022 Summer - Week 7 / Post-Match Discussion |
https://www.reddit.com/r/leagueoflegends/comments/wmr882/sk_gaming_vs_team_vitality_lec_2022_summer_week_7/
|
SK Gaming vs Team Vitality LEC Summer Week Post Match DiscussionLEC SUMMER Official page Leaguepedia Liquipedia Live Discussion Eventvods com New to LoL SK Gaming Team Vitality SK Leaguepedia Liquipedia Website Twitter Facebook YouTube Subreddit VIT Leaguepedia Liquipedia Website Twitter Facebook YouTube Subreddit MATCH SK vs VIT Winner SK Gaming in m MVP Treatz Bans Bans G K T D B SK trundle yuumi wukong alistar taric k O C B I I VIT poppy kalista renata glasc xayah gwen k H H I SK vs VIT JNX darius TOP ornn Alphari Gilius vi JNG jarvan iv Haru Sertuss leblanc MID ahri Perkz Jezu yasuo BOT sivir Carzzy Treatz rakan SUP galio Labrov This thread was created by the Post Match Team submitted by u Embarrassed Can to r leagueoflegends link comments |
2022-08-12 17:39:56 |
コメント
コメントを投稿