Skip to content

Instantly share code, notes, and snippets.

View 2garryn's full-sized avatar

Artem Golovinsky 2garryn

  • Russia, Saint-Petersburg
View GitHub Profile
var Calcs = React.createClass({
getInitialState: function() {
return {count: ''};
},
handleClickNum: function(index) {
this.setState({count: index});
},
render: function() {
var Calcs = React.createClass({
getInitialState: function() {
return {count: ''};
},
handleClickNum: function(index) {
console.log("Adsads", index);
this.setState({count: index});
},
-module(nasoc_conn_handler2).
-export([]).
-record(state, {cli_socket :: inet:socket(),
ext_socket :: inet:socket(),
cli_ip_port :: {ip_address(), ip_port()},
package HelloPackage;
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
-module(example).
-behaviour(gen_server).
%% API
-export([start_link/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
%%%-------------------------------------------------------------------
%%% @author Artem Golovinsky <[email protected]>
%%% @copyright (C) 2012, Artem Golovinsky
%%% @doc Header file for epatom.
%%%
%%% Name of element/attribute is element_name()/attr_name(),
%%% when it is defined in RFC4287 and presented
%%% in http://www.w3.org/2005/Atom namespace.
%%% Otherwise, name of element/attribute is string()
%%%
@2garryn
2garryn / gist:1468643
Created December 12, 2011 19:15
Test code to create tree
fill_elem_tree(C, AppIntId, ElemId) ->
case db:get(C, AppIntId, ElemId) of
{error, not_found} ->
{error, {?MODULE, no_value}};
Value ->
ResultRec = wac_lib:from_binary(term, Value),
ChildsRec = [fill_elem_tree(C, AppIntId, ChildElId) ||
ChildElId <- ResultRec#elem.childs],
#elem_info{id = ResultRec#elem.id,
name = ResultRec#elem.name,