Skip to content

Instantly share code, notes, and snippets.

View svasva's full-sized avatar

Vitaly A. Sorokin svasva

View GitHub Profile
{
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"fold_buttons": false,
"folder_exclude_patterns":
[
".svn",
<?php
function api_query($http_method, $method, array $req = array()) {
$key = '';
$secret = '';
$post_data = $http_method == 'POST' ? json_encode($req) : '';
$sign = hash_hmac('sha512', $post_data, $secret);
$headers = array(
'Content-type: application/json',
CoinEx API
# All timestamps are in UTC
# All currency amounts and exchange rates are multiplied by 10^8 to get rid of floating point numbers
# All API requests should contain HTTP header 'Content-type: application/json'
# Private API methods should have API-Key and API-Sign headers
# API-Key header should contain your API access key which can be generated
# at your account settings page
# API-Sign header should contain request's POST data signed by your account's
# curl -H "Content-Type: application/json" -d '{"order":{"trade_pair_id":73, "amount":1000000,
"cancelled":false, "complete":false, "bid": false, "rate":111111111111100000000}}' http://localhost:3000/api/v1/orders
>>>
Started POST "/api/v1/orders" for 127.0.0.1 at 2013-12-13 01:30:05 +0400
Processing by Api::V1::OrdersController#create as JSON
Parameters: {"order"=>{"trade_pair_id"=>73, "amount"=>1000000, "cancelled"=>false,
"complete"=>false, "bid"=>false, "rate"=>430646668842690304}}
Cx.ResetPasswordRoute = Em.Route.extend
beforeModel: (route) ->
if !@controllerFor('auth').get('isSignedIn') && !route.params.token
@transitionTo('tradeIndex')
Cx.ResetPasswordTokenRoute = Em.Route.extend
model: (params) -> params
setupController: (c, params) ->
@controllerFor('resetPassword').set 'token', params.token
DEPOSITS/WITHDRAWALS:
{ "_id" : "8EoGDgYM9SQ6YMu8x", "address" : "114sdunbXqgZxUsGXaeMePixxsg4zDc6yW", "amount" : -20000000, "category" : "send", "comment" : null, "confirmations" : 0, "currId" : "MAN2xrJTheM6P35Jx", "time" : 1378941452, "txid" : "eb0af36a8272cb6d9da63af3b4699691932cc258b0ba45351c7addd8aba5a228", "userId" : "uBptorh4528e3opwi" }
{ "_id" : "AptKP5K2Ny2RZpjMH", "address" : "1gVKFXTg1gW7vjddcDnYGR1WeQZ1Lixm6", "amount" : 1585831, "category" : "receive", "comment" : null, "confirmations" : 3, "currId" : "MAN2xrJTheM6P35Jx", "time" : 1378698366, "txid" : "f347cf29a24dc22d2e67db5d8e61e60bf60931d5cbfe00e783b309bf85990c7f", "userId" : "uBptorh4528e3opwi", "walletId" : "e969LfFGaygx46CSQ" }
{ "_id" : "LyZ8fbvR2XekGhGtF", "address" : "1gVKFXTg1gW7vjddcDnYGR1WeQZ1Lixm6", "amount" : 5137155, "category" : "receive", "comment" : null, "confirmations" : 3, "currId" : "MAN2xrJTheM6P35Jx", "time" : 1378701686, "txid" : "68a3fa632d98e2b5f2de9a35272065906bb4073592d24a3bd8999d502f36fac2", "userId" : "uBptorh452
Cx.ApplicationRoute = Ember.Route.extend
model: ->
Ember.RSVP.hash(
messages: @store.findAll 'message'
currencies: @store.findAll 'currency'
tradePairs: @store.findAll 'tradePair'
).then (m) -> m
setupController: (c, m) ->
@controllerFor('tradePairs').set 'model', m.tradePairs
@controllerFor('currencies').set 'model', m.currencies
Cx.User = DS.Model.extend
email: DS.attr('string')
nickname: DS.attr('string')
createdAt: DS.attr('date')
notifications: DS.hasMany('notification', {async: true})
Cx.Notification = DS.Model.extend
user: DS.belongsTo('user')
title: DS.attr('string')
body: DS.attr('string')
@h.setupPusher = (store, model, key) ->
manyHash = (d) ->
h = {}
h[model.pluralize()] = [d]
return h
c = pusher.subscribe(key)
c.bind "#{model}#new", (o) ->
Ember.run.later ->
return if store.getById(model, o.id)
Cx.RecentTradesComponent = Ember.Component.extend
ctrl: Ember.ArrayController.create
sortProperties: ['created_at']
sortAscending: false
sortedTrades: (->
proxy = Ember.ArrayProxy.create()
@ctrl.set('content', @get('trades'))
proxy.set('content', @ctrl.get('arrangedContent'))
proxy
).property('trades')