PouchDB server is a nodejs implementation of CouchDB. Below is the steps to use AmazonRDS and NowJS to deploy your own PouchDB Server. Using MySQL as a persistent backend.
Create a Amazon Web Services Account
// | |
// UIImage+Retina4.h | |
// StunOMatic | |
// | |
// Created by Benjamin Stahlhood on 9/12/12. | |
// Copyright (c) 2012 DS Media Labs. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
(function() { | |
var proxy = function(source, eventName) { | |
var _self = this; | |
source.on(eventName, function(evt) { | |
var args = Array.prototype.slice.apply(arguments).splice(1); | |
args.unshift(evt); | |
_self.trigger.apply(_self, args); | |
}); | |
}; |
- (NSString *)tableView:(UITableView *)tableView titleForSwipeAccessoryButtonForRowAtIndexPath:(NSIndexPath *)indexPath { | |
return @"More"; | |
} | |
- (void)tableView:(UITableView *)tableView swipeAccessoryButtonPushedForRowAtIndexPath:(NSIndexPath *)indexPath { | |
NSLog(@"I wanted to be a pretty public API, but then time ran out and they forgot me..."); | |
// Hide the More/Delete menu. | |
[self setEditing:NO animated:YES]; | |
} |
import Foundation | |
extension NSData { | |
func MD5() -> NSString { | |
let digestLength = Int(CC_MD5_DIGEST_LENGTH) | |
let md5Buffer = UnsafeMutablePointer<CUnsignedChar>.alloc(digestLength) | |
CC_MD5(bytes, CC_LONG(length), md5Buffer) | |
var output = NSMutableString(capacity: Int(CC_MD5_DIGEST_LENGTH * 2)) | |
for i in 0..<digestLength { |
#coding: utf8 | |
""" | |
1. Download this gist. | |
2. Get the MNIST data. | |
wget http://deeplearning.net/data/mnist/mnist.pkl.gz | |
3. Run this code. | |
python autoencoder.py 100 -e 1 -b 20 -v | |
""" | |
import numpy | |
import argparse |
#!/usr/bin/env python | |
""" | |
This module will bootstrap a machine using chef. The purpose of this | |
script is actually to work with AWS Auto Scaling Groups. The user data | |
for the Launch Configuration is set to download this script and then | |
run it. This is also stores the results in a private gist and sends | |
a message to logstash with the results. | |
""" |
PouchDB server is a nodejs implementation of CouchDB. Below is the steps to use AmazonRDS and NowJS to deploy your own PouchDB Server. Using MySQL as a persistent backend.
Create a Amazon Web Services Account
const val TAG_LENGTH = 16 | |
class EncryptionOutput(val iv: ByteArray, | |
val tag: ByteArray, | |
val ciphertext: ByteArray) | |
fun encrypt(key: SecretKey, message: ByteArray): EncryptionOutput { | |
val cipher = Cipher.getInstance("AES/GCM/NoPadding") | |
cipher.init(Cipher.ENCRYPT_MODE, key) | |
val iv = cipher.iv.copyOf() |
Ruby の HTTP クライアントライブラリ Faraday が便利そう
API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた
[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた
# Knife Configuration File. | |
# | |
# This is a Ruby DSL to set configuration parameters for Knife's | |
# general options. The default location for this file is | |
# ~/.chef/knife.rb. If multiple Chef repositories are used, | |
# per-repository configuration files can be created. A per repository | |
# configuration file must be .chef/knife.rb in the base directory of | |
# the Chef repository. For example, | |
# | |
# ~/Development/chef-repo/.chef/knife.rb |