Skip to content

Instantly share code, notes, and snippets.

View azs06's full-sized avatar
:octocat:
Focusing

Md. Atiquzzaman Soikat azs06

:octocat:
Focusing
View GitHub Profile
@azs06
azs06 / introrx.md
Last active August 29, 2015 14:23 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@azs06
azs06 / jugglingAsync.js
Created August 28, 2016 15:29
Learnyounode juggling async solution using es6 promises
const http = require('http');
const urls = process.argv.slice(2, process.argv.length);
let fetchData = function(url){
return new Promise(function(resolve, reject) {
http.get(url, (res)=>{
let data = '';
res.setEncoding('utf8');
//res.resume();
res.on('data',(chunk)=>{
@azs06
azs06 / timeServer.js
Created August 29, 2016 15:33
Learnyounode time server solution
const net = require('net');
const portNumber = process.argv[2] || 8000;
let date = new Date();
let month = zeroCheck(date.getUTCMonth() + 1);
let monthDate = zeroCheck(date.getDate());
let hours = zeroCheck(date.getHours());
let minutes = zeroCheck(date.getMinutes());
function zeroCheck(moment){
@azs06
azs06 / fileServer.js
Created August 30, 2016 16:09
Learnyounode file sever solution
const http = require('http');
const fs = require('fs');
let fileLocation = process.argv[3];
let portNumber = process.argv[2];
const stream = fs.createReadStream(fileLocation);
let server = http.createServer((req,res)=>{
res.writeHead(200, {'content-type': 'text/plain'});
@azs06
azs06 / httpJsonServer.js
Created September 1, 2016 16:14
learnyounode json server
const http = require('http');
const url = require('url');
const port = process.argv[2] || 4200;
let body = '';
let server = http.createServer((req, res)=>{
res.writeHead(200, { 'Content-Type': 'application/json' });
req.on('data',(chunk)=>{
@azs06
azs06 / select_component.hbs
Created November 7, 2016 18:56
select component for ember
<script type="text/x-handlebars" id="components/custom-select">
<select disabled={{disabled}} class="{{class}}" {{action 'change' on='change'}}>
{{#if prompt}}
<option disabled selected={{is-not selection}}>
{{prompt}}
</option>
{{/if}}
{{#if groups}}
{{#each groups as |group|}}
@azs06
azs06 / tdz.md
Created March 15, 2017 08:00
Temporal dead zone in JavaScript
@azs06
azs06 / routeLifeCycyle.js
Last active May 19, 2017 19:15 — forked from Andrew-Max/gist:305483febc3c367dbf57
Route lifecycle hooks guide from Ember meetup lightning talk
App.LibraryRoute = App.ApplicationRoute.extend({
activate: function () {
//no longer enter
this._super();
only called once on entering a route.
},
beforeModel: function () {
// any state you want in place before the model is initialized, this is called before any model promises are resolved
// also could be used to conditionally prevent access to a route by throwing transition.abort
@azs06
azs06 / commands.md
Last active August 15, 2017 14:02
Essential command line commands
  • Change directory cd
  • cd without any argument will take to home directory
  • pwd prints the current working directory
  • wc is used to count words in file
  • cat is used to contcat files, also used to display file contents.