Skip to content

Instantly share code, notes, and snippets.

View ishan-marikar's full-sized avatar

Ishan Marikar ishan-marikar

View GitHub Profile
@ishan-marikar
ishan-marikar / READLE.md
Created January 31, 2018 20:12 — forked from glejeune/READLE.md
A (very) simple chat service using MQTT

Run

  1. Install and run an MQTT server (mosquitto is a good choise)

  2. Install mqtt and ncurses-ruby gems

    sudo gem install ruby-mqtt ncurses-ruby

  3. Run the client

ruby ./mqtt-chat.rb

@ishan-marikar
ishan-marikar / gitpatch.sh
Created January 22, 2018 07:54 — forked from tecoholic/gitpatch.sh
Creating Patches in GIT
#To visualize branches:
git branch
#To create a new branch:
git branch testbranch
#To change to created branch:
git checkout testbranch
#Track new files:
@ishan-marikar
ishan-marikar / Using Git Patch.md
Created January 22, 2018 07:34 — forked from deanrather/Using Git Patch.md
How to use Git Patch

How to use Git Patch

In this scenario, a Git Repo has been exported, and the contents of the repo deployed onto an environment.

This deployment does not have any knowledge of Git.

On the deployment:

Initialise a new git repo, so any changes can be tracked.

@ishan-marikar
ishan-marikar / gitflow-breakdown.md
Created January 19, 2018 07:13 — forked from junkmechanic/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@ishan-marikar
ishan-marikar / introrx.md
Created January 19, 2018 07:12 — forked from lolocoo/introrx.md
The introduction to Reactive Programming you've been missing
@ishan-marikar
ishan-marikar / deezer-mp3-download.js
Created January 14, 2018 06:12
Download - stream a deezer song / playlist / album in 320kbps, for educational purposes only ;). Strongly inspired by https://github.com/jaimehrubiks/deezer-download
const Promise = require("bluebird");
const request = require("request-promise");
const ID3Writer = require('browser-id3-writer');
const crypto = require('crypto');
const format = require('util').format;
const fs = require("fs");
const http = require('http');
// Download a deezer song / playlist / album

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

@ishan-marikar
ishan-marikar / random.js
Created January 4, 2018 20:15 — forked from kerimdzhanov/random.js
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
const facebook = require("facebook-chat-api");
const birthdayWishes = require("./birthday-wishes.json");
const schedule = require("node-schedule");
const fs = require("fs");
function sendGreetings() {
facebook(
{ email: process.env.USERNAME, password: process.env.PASSWORD },
(error, api) => {
if (error) throw error;
#!/bin/bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker
sudo usermod -aG docker ${USER}
id -nG