type StringBool = "true"|"false";
interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };
type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
// Register your service as usual. I suggest adding it to [providers] in the module definition | |
// Then... | |
... | |
var user = ...; | |
var info = ...; // Optional | |
var timestamp = Date.now() / 1000 | 0; | |
var token = <Get the token from your ws>; | |
this.centrifugeService.connect({ | |
url: 'http://<centrifugoServer>:8000/connection', |
var TRIPLET_NAMES = [ | |
null, | |
['тысяча', 'тысячи', 'тысяч'], | |
['миллион', 'миллиона', 'миллионов'], | |
['миллиард', 'миллиарда', 'миллиардов'], | |
['триллион', 'триллиона', 'триллионов'], | |
['квадриллион', 'квадриллиона', 'квадриллионов'], | |
], | |
ZERO_NAME = 'нуль', | |
ONE_THOUSANT_NAME = 'одна', |
#!upstart | |
start on filesystem and started networking | |
stop on shutdown | |
expect fork | |
setuid ubuntu | |
env HOME="/home/ubuntu" |
uint32 blend(uint32 color1, uint32 color2, uint8 alpha) { | |
uint32 rb = color1 & 0xff00ff; | |
uint32 g = color1 & 0x00ff00; | |
rb += ((color2 & 0xff00ff) - rb) * alpha >> 8; | |
g += ((color2 & 0x00ff00) - g) * alpha >> 8; | |
return (rb & 0xff00ff) | (g & 0xff00); | |
} |
List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.
http://www.w3.org/TR/WebCryptoAPI/
This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
-
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
(function($) { | |
if ( !$.cssHooks ) { | |
throw("jQuery 1.4.3+ is needed for this plugin to work"); | |
return; | |
} | |
function styleSupport( prop ) { | |
var vendorProp, supportedProp, | |
capProp = prop.charAt(0).toUpperCase() + prop.slice(1), | |
prefixes = [ "Moz", "Webkit", "O", "ms" ], |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
var mongoose = require('./db-connect'), | |
Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId, | |
uuid = require('node-uuid'), | |
Validator = require('validator').Validator, | |
val = new Validator(), | |
bcrypt = require('bcrypt'); | |
Validator.prototype.error = function(msg) { return false; }; |