create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
require 'rubygems' | |
require 'mongo' | |
module MongoPubSub | |
QUEUES_COLLECTION = 'queues' | |
class EndSubscriptionException < Exception; end | |
class Publisher | |
def initialize(queue_name, mongo_connection) | |
# Initialize queue collection as a capped collection | |
if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name) |
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; }; |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
(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" ], |
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>
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.
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); | |
} |
#!upstart | |
start on filesystem and started networking | |
stop on shutdown | |
expect fork | |
setuid ubuntu | |
env HOME="/home/ubuntu" |
var TRIPLET_NAMES = [ | |
null, | |
['тысяча', 'тысячи', 'тысяч'], | |
['миллион', 'миллиона', 'миллионов'], | |
['миллиард', 'миллиарда', 'миллиардов'], | |
['триллион', 'триллиона', 'триллионов'], | |
['квадриллион', 'квадриллиона', 'квадриллионов'], | |
], | |
ZERO_NAME = 'нуль', | |
ONE_THOUSANT_NAME = 'одна', |
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"];