Skip to content

Instantly share code, notes, and snippets.

View rtnpro's full-sized avatar

Ratnadeep Debnath rtnpro

View GitHub Profile
@rtnpro
rtnpro / server.js
Created April 22, 2020 17:33
PDF/File creation and download using server-side ASYNC methods in Meteor
if (Meteor.isServer) {
/* Use Fibers/Future */
var Future = Npm.require('fibers/future');
/* Async Method */
function generatePDF(id, options, callback){
check(id, String);
check(options, Object);
@rtnpro
rtnpro / nginx_odoo_multiprocess
Created August 1, 2018 02:43 — forked from funbaker/nginx_odoo_multiprocess
odoo nginx static files
upstream odoo9_xmlrpc {
server <xmlrpc address>;
}
upstream odoo9_longpolling {
server <longpolling address>;
}
server {
listen 80;
@rtnpro
rtnpro / blue-green.groovy
Created December 20, 2017 13:05 — forked from klingerf/blue-green.groovy
Jenkins pipeline script to perform blue-green deploys to a Kubernetes cluster running linkerd and namerd
node {
def currentVersion = getCurrentVersion()
def newVersion = getNextVersion(currentVersion)
def frontendIp = kubectl("get svc l5d -o jsonpath=\"{.status.loadBalancer.ingress[0].ip}\"").trim()
def originalDst = getDst(getDtab())
stage("clone") {
git url: gitRepo + '.git', branch: gitBranch
}
@rtnpro
rtnpro / blue-green.groovy
Created December 20, 2017 13:05 — forked from klingerf/blue-green.groovy
Jenkins pipeline script to perform blue-green deploys to a Kubernetes cluster running linkerd and namerd
node {
def currentVersion = getCurrentVersion()
def newVersion = getNextVersion(currentVersion)
def frontendIp = kubectl("get svc l5d -o jsonpath=\"{.status.loadBalancer.ingress[0].ip}\"").trim()
def originalDst = getDst(getDtab())
stage("clone") {
git url: gitRepo + '.git', branch: gitBranch
}

Nulecule Lifecycle Definition

unpack (or fetch)

Will download all artifacts including sample answers.conf file into a local directory for inspection and/or modification. If the current application has external dependencies on other nulecule applications, it will recursively unpack the nulecule dependencies as well. Possible destination is /var/atomicapp/<uniquedirname>. Same for all providers.

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

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.

server {
listen 80;
server_name app.example.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443;
server_name app.example.com;
# Public Domain, i.e. feel free to copy/paste
# Considered a hack in Python 2
import inspect
def caller_name(skip=2):
"""Get a name of a caller in the format module.class.method
`skip` specifies how many levels of stack to skip while getting caller
name. skip=1 means "who calls me", skip=2 "who calls my caller" etc.