Skip to content

Instantly share code, notes, and snippets.

View aj07's full-sized avatar

aj07 aj07

  • Open Source
  • Remote
View GitHub Profile
@aj07
aj07 / accesscontrol
Created January 13, 2018 05:50
hyperldgersetup
/** * Access control rules for mynetwork */
rule Default {
description: "Allow all participants access to all resources"
participant: "ANY" operation: ALL resource: "org.acme.mynetwork.*"
action: ALLOW
}
rule SystemACL {
description: "System ACL to permit all access"
participant: "org.hyperledger.composer.system.Participant"
operation: ALL
@aj07
aj07 / accesscontrol.md
Created January 13, 2018 05:50
hyperldgersetup

/** * Access control rules for mynetwork / rule Default { description: "Allow all participants access to all resources" participant: "ANY" operation: ALL resource: "org.acme.mynetwork." action: ALLOW } rule SystemACL { description: "System ACL to permit all access" participant: "org.hyperledger.composer.system.Participant" operation: ALL

@aj07
aj07 / json
Created December 28, 2017 16:58
{
"config": {
"chainId": 0,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc" : {},
"coinbase" : "0x0000000000000000000000000000000000000000",
"difficulty" : "0x20000",
@aj07
aj07 / erc20.sol
Created December 26, 2017 13:02
erc20 format
pragma solidity ^0.4.8;
contract ERC20Interface {
// Get the total token supply
function totalSupply() constant returns (uint256 totalSupply);
[root@node5 glusterfs-coreutils]# gfls --help
Usage: gfls [OPTION]... URL
list directory contents
-a, --all do not ignore entries starting with .
-h, --human-readable with -l, print sizes in human readable
format (e.g., 1K 234M 2G)
-l use a long listing format
-R, --recursive list subdirectories recursively
-p, --port=PORT specify the port on which to connect
<%= simple_form_for ([@store, @store.delivery_preferences.build]) , :url => {:controller=>'delivery_preferences',:action=>'create'},:html=>{:class=>'delivery_preference_form'},:remote=>true do |f| %>
class DeliveryPreferencesController < ApplicationController
before_action :set_store
def new
@delivery_preference = DeliveryPreference.new
end
def create
@delivery_preference = DeliveryPreference.new(delivery_preference_params)
@delivery_preference.store_id = @store.id
class DeliveryPreferencesController < ApplicationController
before_action :set_store
def new
@delivery_preference = DeliveryPreference.new
end
def create
@delivery_preference = DeliveryPreference.new(delivery_preference_params)
@delivery_preference.store_id = @store.id
<div class="form-group">
<%= f.label :from_date, "From Date", :class => 'control-label col-md-2' %>
<div class="col-md-10">
<%= f.text_field :from_date, :class => 'form-control date', :placeholder => "Start Date", :value => "#{ f.object.from_date.nil? ? " " : f.object.from_date.now.strftime("%m/%d/%Y")}" %>
</div>
@aj07
aj07 / Issue_01.txt
Last active March 21, 2016 00:51
Implementing Multiplex
Celluloid needs a "Reactor" for handling collections of blocking processes such as Future.value and Condition.wait. This will allow them to call thread while also to continue processing when any of the blocking processes are available for synchronous operations to proceed.
Example:
futures = [
Celluloid::Future.new { sleep 8; 3+5 },
Celluloid::Future.new { sleep 3; 1+2 },
Celluloid::Future.new { sleep 9; 2+7 },
Celluloid::Future.new { sleep 5; 2+3 }
]
futures.map(&:value).map { |v| puts v }