This file contains 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 { isBefore, setHours, setMinutes, setSeconds, addMinutes, setMilliseconds } from 'date-fns' | |
const setTime = (x, h = 0, m = 0, s = 0, ms = 0) => setHours(setMinutes(setSeconds(setMilliseconds(x, ms), s), m), h) | |
const from = setTime(new Date(), 9) | |
const to = setTime(new Date(), 17) | |
const step = (x) => addMinutes(x, 30) | |
const blocks = [] | |
let cursor = from |
This file contains 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 { isSameMonth, startOfMonth } from 'date-fns' | |
export const generateCalendar = ( | |
firstDateOfMonth: Date | |
): number[][] => { | |
const date = startOfMonth(firstDateOfMonth) | |
const getDay = (date: Date) => { | |
let day = date.getDay() | |
if (day === 0) day = 7 |
This file contains 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, { Component } from 'react'; | |
import { WebView, BackHandler } from 'react-native'; | |
export default class WebViewMoviezSpace extends Component { | |
constructor(props) { | |
super(props); | |
this.WEBVIEW_REF = React.createRef(); | |
} | |
componentDidMount() { |
This file contains 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
const CognitoIdentityServiceProvider = require("amazon-cognito-identity-js"); | |
// Required in order to use the cognito js library to work. | |
global.fetch = require("node-fetch"); | |
/** | |
* Authenticate a cognito user and return its authentication token. Use the auth token in the authorization header | |
* @param callback Callback function with error as first param and the actual user token in the second param. | |
*/ | |
function authenticateUser(callback) { |
This file contains 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
--- | |
Description: AWS AppSync Notes API | |
Parameters: | |
APIName: | |
Type: String | |
Description: Name of the API - used to generate unique names for resources | |
MinLength: 3 | |
MaxLength: 20 | |
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$' |
This file contains 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 numpy as np | |
### <summary> | |
### Basic template algorithm simply initializes the date range and cash. This is a skeleton | |
### framework you can use for designing an algorithm. | |
### </summary> | |
class BasicTemplateAlgorithm(QCAlgorithm): | |
'''Basic template algorithm simply initializes the date range and cash''' | |
def Initialize(self): |
This file contains 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'; | |
exports.handler = (event, context, callback) => { | |
// Get request and request headers | |
const request = event.Records[0].cf.request; | |
const headers = request.headers; | |
// Configure authentication | |
const authUser = 'user'; | |
const authPass = 'pass'; |
This file contains 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
const wait = ( | |
time, | |
cancel = Promise.reject() | |
) => new Promise((resolve, reject) => { | |
const timer = setTimeout(resolve, time); | |
const noop = () => {}; | |
cancel.then(() => { | |
clearTimeout(timer); | |
reject(new Error('Cancelled')); |
This file contains 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
$font-scale: 1.333; | |
$font-base-size: 1em; | |
$font-size: $font-base-size; | |
@for $i from 6 through 1 { | |
h#{$i} { | |
font-size: $font-size; | |
} | |
$font-size: $font-size * $font-scale; | |
} |
This file contains 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
<ifModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule (.*) /index.html [QSA,L] | |
</ifModule> |
NewerOlder