Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
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 { useCallback, useEffect, useState } from "react"; | |
| // Define custom types for SpeechRecognition and SpeechRecognitionEvent | |
| interface ISpeechRecognitionEvent extends Event { | |
| results: SpeechRecognitionResultList; | |
| resultIndex: number; | |
| } | |
| interface ISpeechRecognition extends EventTarget { | |
| lang: string; |
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
| <?php | |
| namespace App\Libraries\Queue; | |
| use Illuminate\Events\Dispatcher; | |
| use Illuminate\Queue\DatabaseQueue; | |
| use Illuminate\Support\Str; | |
| use Laravel\Horizon\Events\JobDeleted; | |
| use Laravel\Horizon\Events\JobPushed; | |
| use Laravel\Horizon\Events\JobReleased; |
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
| package main | |
| import ( | |
| "log" | |
| "net/smtp" | |
| ) | |
| func main() { | |
| send("hello there") | |
| } |
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
| FROM node:15.3.0-alpine3.10 as deps | |
| WORKDIR /app | |
| COPY package.json yarn.lock ./ | |
| RUN yarn --production --silent | |
| RUN cp -R node_modules prod_node_modules | |
| RUN yarn --frozen-lockfile --silent | |
| FROM deps as builder | |
| WORKDIR /app | |
| COPY . . |
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
| function useSelectors(reducer, mapStateToSelectors) { | |
| const [state] = reducer; | |
| const selectors = useMemo(() => mapStateToSelectors(state), [state]); | |
| return selectors; | |
| } | |
| function useActions(reducer, mapDispatchToActions) { | |
| const [, dispatch] = reducer; | |
| const actions = useMemo(() => mapDispatchToActions(dispatch), [dispatch]); | |
| return actions; |
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
| function add_custom_headers() { | |
| add_filter( 'rest_pre_serve_request', function( $value ) { | |
| header( 'Access-Control-Allow-Headers: Authorization, X-WP-Nonce,Content-Type, X-Requested-With'); | |
| header( 'Access-Control-Allow-Origin: *' ); | |
| header( 'Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE' ); | |
| header( 'Access-Control-Allow-Credentials: true' ); | |
| return $value; | |
| } ); |
It took me quite some time to figure out how to print properly from a web application. I will explain here how I did it, so you don't have to spend the same time.
Google Cloud Print API uses OAuth 2.0 for authorization.
As explained [here][1] on the Google Developer page, the best way to use OAuth with the Google API is with a Google service account. Create a service account as explained on the Google Developer page.
To use OAuth a library is required. Google has published the [Google API PHP client library][2]. If you want to use the examples from the Developer pages, you need to use version 1 of the library. In this article I use version 2 of the library.
NewerOlder