Provide weather and water forecasts to the customer to find a good day for a swim.
- Create a view to display the following information:
- Title
- Location (static)
- Day selector
// AuthProvider.tsx (this is an abstraction) | |
type AuthProvider = () => { | |
getToken(): Promise<string>; | |
}; | |
export const { | |
useContext, | |
createContextProvider: provideAuth, | |
} = createGenericContext<AuthProvider>(); |
# ~/.oh-my-zsh/custom/git-checkout-remote-branch-ohmyzsh-alias.zsh | |
unalias gcor | |
function gcor() { | |
if [ -n "$1" ]; then | |
if git show-ref -q --heads $1; then | |
gco $1 | |
else | |
gfo $1 | |
gco -t origin/$1 | |
fi |
# ~/.oh-my-zsh/custom/git-rebase-master-ohmyzsh-alias.zsh | |
alias grbmo='gup origin master' |
function sendToNative(data: string) { | |
if (/android/i.test(window.navigator.userAgent)) { | |
if (window.quicketNative) { | |
return window.quicketNative.send(data); | |
} | |
} | |
let frame = document.createElement('iframe'); | |
frame.width = '100'; |
import mongoose from 'mongoose'; | |
let schema = new mongoose.Schema({ | |
email: { type: String, required: true, unique: true }, | |
password: { type: String, required: true } | |
}); | |
schema.statics.findOrCreate = async (conditions, opt_attr) => { | |
let document = await User.findOne(conditions); |
autocomplete="off"
onto <form>
element;<input>
with autocomplete="false"
as a first children element of the form.<form autocomplete="off" method="post" action="">
<input autocomplete="false" name="hidden" type="text" style="display:none;">
...
/** | |
* Takes a style object and returns the corresponding | |
* attribute value. Converts camel case property names | |
* to proper CSS selector names. | |
* @param {Object} obj Map of CSS properties to values. | |
* @return {string} The style attribute value. | |
*/ | |
function toStyleAttribute = function(obj) { | |
return Object.keys(obj).map(function(key) { | |
/** | |
* Sums up all given arguments. | |
* @param {...*} var_args Numbers or numbers alike to sum up. | |
* Numbers will be added as is, numbers in strings (e.g. '123.45') | |
* will be converted to numbers and added. NaNs are skipped. | |
* @return {number} The sum of number arguments. | |
*/ | |
function sum(var_args) { | |
var args = [].slice.call(arguments); | |
'use strict'; | |
var Promise = require('promise'); | |
function build() { | |
return new Promise(function(fulfill, reject) { | |
fulfill('zero'); | |
}); |