Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
```dataviewjs | |
// find dates based on format [[YYYY-MM-DD]] | |
const findDated = (task)=>{ | |
if( !task.completed ) { | |
task.link = " " + "[[" + task.path + "|*]]"; | |
task.date=""; | |
const found = task.text.match(/\[\[([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))\]\]/); | |
if(found) task.date = moment(found[1]); | |
return true; | |
} |
pragma solidity ^0.4.19; | |
contract ERC721 { | |
string constant private tokenName = "My ERC721 Token"; | |
string constant private tokenSymbol = "MET"; | |
uint256 constant private totalTokens = 1000000; | |
mapping(address => uint) private balances; | |
mapping(uint256 => address) private tokenOwners; | |
mapping(uint256 => bool) private tokenExists; | |
mapping(address => mapping (address => uint256)) private allowed; | |
mapping(address => mapping(uint256 => uint256)) private ownerTokens; |
........... | |
calculateVolumePriceConversionCoefficient = function(currentObj1, currentObj2, timestampForCalculation){ | |
var timePassedObj1 = timestampForCalculation - currentObj1.LASTUPDATE; | |
var timePassedObj2 = timestampForCalculation - currentObj2.LASTUPDATE; | |
//negative or 0 cap it at 1 | |
if(timePassedObj1 <=0 ){ timePassedObj1 = 1; } | |
if(timePassedObj2 <=0 ){ timePassedObj2 = 1; } | |
//if last update is more than 1 day ago cap it at 1 day | |
if(timePassedObj1 > 86400){ timePassedObj1 = 86400; } |
{ | |
"scope":"source.js", | |
"completions":[ | |
{ | |
"trigger":"a", | |
"contents":"<a${1}>${0}</a>" | |
}, | |
{ | |
"trigger":"abbr", | |
"contents":"<abbr${1}>${0}</abbr>" |
⇐ back to the gist-blog at jrw.fi
Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl
. Hold onto your hats, there's some Bucket Policy acrobatics ahead.
There's also a tl;dr at the very end if you just want the delicious copy-pasta.
var uuid = require('node-uuid'), | |
https = require('https'); | |
function iCloud(appleId, password) { | |
this.urls = { | |
"version" : "https://www.icloud.com/system/version.json", | |
"validate": "/setup/ws/1/validate?clientBuildNumber={0}&clientId={1}", | |
"login": "/setup/ws/1/login?clientBuildNumber={0}&clientId={1}" | |
} |
This presenation is an exploration of rolling your own data persistence for and Ember.js Application
During this discovery I attempt to roll my own data solution. I've selected to use alpha software, Orbit.js. So not also choosing other alpha software at the some time. Not covering es6, broccoli, ember-cli etc.
The exploratory app is based on converting my blog app (uses REST) to use Web sockets with a Node.js backend. I am using some build tools brunch.io also borrowing from tapas-with-ember. The modules in the source code are [CommonJS modules].
#!/bin/bash | |
#configurable variables | |
SCHEME_NAME="SCHEME-NAME-HERE" | |
DEVELOPER_NAME="iPhone Distribution: YOUR_DEVELOPER_NAME_HERE (ID_HERE)" | |
PROVISIONING_PROFILE="/ABSOLUTE/PATH/TO/PROVISIONING/PROFILE_HERE.mobileprovision" | |
USE_DEFAULT_DEVELOPER_NAME=true | |
USE_DEFAULT_PROVISIONING_PROFILE=true | |
OPEN_DIR_WHEN_FINISHED=false |
The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)
It does not balance, it leaves it to the kernel.
In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)