Skip to content

Instantly share code, notes, and snippets.

View prtk418's full-sized avatar
:shipit:
Chilling

Pratik Agarwal prtk418

:shipit:
Chilling
View GitHub Profile
@voldy
voldy / gist:3699664
Created September 11, 2012 16:27
Ruby on Rails best practices

Ruby on Rails best practices

Code style

  • Use UTF-8. It’s 21 century, 8bit encodings dead now.
  • Use 2 space indent, not tabs
  • Use Unix-style line endings
  • Keep lines not longer than 80 chars
  • Remove trailing whitespace
@staltz
staltz / introrx.md
Last active July 6, 2024 17:07
The introduction to Reactive Programming you've been missing
@carlhoerberg
carlhoerberg / reconnect.js
Created May 13, 2015 14:45
How to build reconnect logic for amqplib
var amqp = require('amqplib/callback_api');
// if the connection is closed or fails to be established at all, we will reconnect
var amqpConn = null;
function start() {
amqp.connect(process.env.CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) {
if (err) {
console.error("[AMQP]", err.message);
return setTimeout(start, 1000);
}
@FaisalJamil
FaisalJamil / MQTTService.java
Created September 29, 2017 12:43
Push notification using MQTT message broker
package com.earthlinktele.faisaljamil.cinemana.push_notification;
import android.app.Notification;
import android.app.Notification.Builder;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
NodeJS Chaincode Deploy and Test
start Docker
cd /fabric-samples/basic-network /basic network
Edit docker-compose.yml change line no 72 comment and 73 uncomment. //prod to devp network
Edit start.sh add ‘cli’ in 15 no. line (docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdb cli)
./start.sh //run start script to up network
docker logs -f peer0.org1.example.com //log (1 terminal)
docker exec -it cli bash //peer (2 terminal)
cd /fabric-samples/chaincode/hyperledger/fabric/peer/nodefiles (3 terminal)