Create and initialize your a directory for your Express application.
$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init
Change your app.json to base-app.json and untrack the original file in your .gitignore
Then add something like
"generateConfig": "rimraf app.json && node generateConfig"
to your package.json
scripts, and yarn generateConfig && react-native-scripts start
to scripts like "start" or any others that may need app.json generated.
from django.db import models | |
from with_distance_manager import WithDistanceManager | |
class Foo(models.Model): | |
longitude = models.DecimalField(max_digits=19, decimal_places=10, null=True) | |
latitude = models.DecimalField(max_digits=19, decimal_places=10, null=True) | |
objects = WithDistanceManager() |
export function* main() { | |
const { payload } = yield take(SOME_START_SIGNAL); | |
const watcherInstance = yield fork(updateResource, payload); | |
// cancel task instance on location change | |
yield take(LOCATION_CHANGE); | |
yield cancel(watcherInstance); | |
} | |
function* updateResource(id) { |
import { call, put, race, fork, take } from 'redux-saga/effects' | |
function delay(duration) { | |
const promise = new Promise(resolve => { | |
setTimeout(() => resolve(true), duration) | |
}); | |
return promise; | |
} | |
// Fetch data every 20 seconds |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
/** | |
* Check if localStorage is supported const isSupported: boolean | |
* Check if localStorage has an Item function hasItem(key: string): boolean | |
* Get the amount of space left in localStorage function getRemainingSpace(): number | |
* Get the maximum amount of space in localStorage function getMaximumSpace(): number | |
* Get the used space in localStorage function getUsedSpace(): number | |
* Get the used space of an item in localStorage function getItemUsedSpace(): number | |
* Backup Assosiative Array interface Backup | |
* Get a Backup of localStorage function getBackup(): Backup | |
* Apply a Backup to localStorage function applyBackup(backup: Backup, fClear: boolean = true, fOverwriteExisting: boolean = true) |
/** | |
* Check if localStorage is supported const isSupported: boolean | |
* Check if localStorage has an Item function hasItem(key: string): boolean | |
* Get the amount of space left in localStorage function getRemainingSpace(): number | |
* Get the maximum amount of space in localStorage function getMaximumSpace(): number | |
* Get the used space in localStorage function getUsedSpace(): number | |
* Backup Assosiative Array interface Backup | |
* Get a Backup of localStorage function getBackup(): Backup | |
* Apply a Backup to localStorage function applyBackup(backup: Backup, fClear: boolean = true, fOverwriteExisting: boolean = true) | |
* Dump all information of localStorage in the console function consoleInfo(fShowMaximumSize: boolean = false) |