#!/bin/bash | |
# Usage: ./init-ts-project.sh my-new-project | |
## Prerequisites: | |
# Install yarn: https://classic.yarnpkg.com/en/docs/install/#windows-stable | |
# Install jq: https://jqlang.github.io/jq/download/ | |
PROJECT_NAME=$1 |
package com.example.jetpackcomposeplayground | |
import android.content.Context | |
import android.graphics.Bitmap | |
import android.graphics.Picture | |
import android.net.Uri | |
import android.os.Environment | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.padding |
https://gist.github.com/search?q=user%3A%40me&ref=searchresults
Uses @me
to refer to itself in the gist search query.
Type this into Github Gist Search (https://gist.github.com/)
user:BoQsc your search query
const fs = require('fs') | |
function readFile (filename) { | |
if (fs.existsSync(filename)) { | |
return fs.readFileSync(filename, 'utf8') | |
} | |
throw new Error('Cannot find file ' + filename) | |
} | |
describe('mocking individual fs sync methods', () => { |
Intro to Progressive Web Apps - https://br.udacity.com/course/intro-to-progressive-web-apps--ud811 | |
Web Tooling & Automation - https://br.udacity.com/course/web-tooling-automation--ud892 | |
Offline Web Applications - https://br.udacity.com/course/offline-web-applications--ud899 |
Asynchronous Programming and Microservices: Comparing Javascript, Erlang and Python with RabbitMQ + Celery
This article is about building asynchronous microservices. I'll compare how this can be achieved in Javascript and Erlang natively, and in Python using RabbitMQ and Celery.
My first encounter with asynchronous programming in python was when building a web backend. Upon completing a purchase, the user should eventually receive a PDF invoice by email. This didn't have to happen immediately during the request; in fact, it was better if it didn't, so as not to slow down the purchase needlessly. At the time I wasn't sure how to implement an asynchronous workflow in python, but a quick google search quickly lead me to Celery and RabbitMQ. Celery is very easy to use; the only pain is setting up a message broker -- RabbitMQ, in my case. Once you're set up, running a task in the background is as easy as writing, in myapp.py
,

printenet
to print environment variablesprintenv | grep APPLICATION
to filter forAPPLICATION
export $(./path/to/file)
to export file's content