Skip to content

Instantly share code, notes, and snippets.

@degensean
degensean / init-ts-project.sh
Last active June 5, 2024 14:17
Initialize a Typescript project using yarn with git
#!/bin/bash
# Usage: ./init-ts-project.sh my-new-project
# Install yarn: https://classic.yarnpkg.com/en/docs/install/#windows-stable
# Install jq: https://jqlang.github.io/jq/download/
PROJECT_NAME=$1
# Check if a project name was provided
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
@falvojr
falvojr / ifood-dev-week.ipynb
Last active July 21, 2023 21:40
ifood-dev-week.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BoQsc
BoQsc / Gists.md
Last active July 18, 2024 21:15
How to search my own Gists
@devarajchidambaram
devarajchidambaram / stubfs.js
Created September 7, 2018 07:28
How to stub fs.readFile functions
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', () => {
@alexaleluia12
alexaleluia12 / pwa-udacity.txt
Created May 13, 2018 15:34
free courses pwa | cursos grátis pwa
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
@egeromin
egeromin / async-experiments.md
Created January 20, 2018 21:33
Asynchronous Programming and Microservices: Comparing Javascript, Erlang and Python with RabbitMQ + Celery

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.

But why?

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,

@LuisErnestoZamb
LuisErnestoZamb / 2017-11-29_15-08-33.jpg
Last active October 30, 2023 13:30
How setting up mysql as localhost and using this outside docker on Mac OS (accessing localhost mysql from docker) - The missing guide
2017-11-29_15-08-33.jpg
@gaboratorium
gaboratorium / bash.md
Created September 14, 2017 11:15
Bash #bash
  • printenet to print environment variables
  • printenv | grep APPLICATION to filter for APPLICATION
  • export $(./path/to/file) to export file's content