Skip to content

Instantly share code, notes, and snippets.

View lpirola's full-sized avatar

Lucas Pirola Dias lpirola

  • São Paulo, Brazil
  • 00:41 (UTC -03:00)
View GitHub Profile
@yefim
yefim / Dockerrun.aws.json
Last active July 22, 2025 01:10
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@idibidiart
idibidiart / GraphQL-Architecture.md
Last active March 21, 2026 11:15
Building an Agile, Maintainable Architecture with GraphQL

Building a Maintainable, Agile Architecture for Realtime, Transactional Apps

A maintainable application architecture requires that the UI only contain the rendering logic and execute queries and mutations against the underlying data model on the server. A maintainable architecture must not contain any logic for composing "app state" on the client as that would necessarily embed business logic in the client. App state should be persisted to the database and the client projection of it should be composed in the mid tier, and refreshed as mutations occur on the server (and after network interruption) for a highly interactive, realtime UX.

With GraphQL we are able to define an easy-to-change application-level data schema on the server that captures the types and relationships in our data, and wiring it to data sources via resolvers that leverage our db's own query language (or data-oriented, uniform service APIs) to resolve client-specified "queries" and "mutations" against the schema.

We use GraphQL to dyn

@robertknight
robertknight / Build.md
Last active July 8, 2022 01:32
Minimal Webpack DllPlugin example

Compile with:

webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.js

Use with the following index.html

#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
@jdnichollsc
jdnichollsc / pdf.js
Created January 17, 2016 20:41
Generate PDF in base64 with jsPDF
services.factory('PDF', ['$q', function ($q) {
var createSubtopic = function (doc, subtopic, top, pageWidth) {
doc.autoTable([
{ title: "Title", dataKey: "title" },
{ title: "Value", dataKey: "value" }
], [
{ title: "Estándar", value: subtopic.standard },
{ title: "Tema", value: subtopic.topic },
@maslick
maslick / pg_dump
Created January 7, 2016 07:50
Docker container for pg_dump
FROM postgres
ENTRYPOINT ["/usr/bin/pg_dump"]
@kenhoff
kenhoff / server.js
Created October 2, 2015 21:36
A simple node.js server using harp.js and passport.js to only allow access to users in the Microsoft Azure AD.
// require('harp').server(__dirname, { port: process.env.PORT || 5000 })
console.log(process.env.NODE_ENV)
express = require('express')
session = require('express-session')
passport = require('passport')
harp = require('harp')
app = express()
app.use(session({ secret:"whatever"}))
@vitorbaptista
vitorbaptista / generate-data.sh
Last active August 29, 2015 14:26
Generates CSV with name, id, email and image of the politicians on https://github.com/everypolitician/everypolitician-data
#!/bin/bash
echo "name,id,email,image"
for file in `find . -name ep-popolo-v1.0.json`
do
cat $file | jq -r ".persons[] | [\"$file\", .id, .email, .image] | @csv"
done
@Dr-Nikson
Dr-Nikson / README.md
Last active January 14, 2019 06:35 — forked from vjpr/README.md

Reduce boilerplate in Redux

  • Create actions similar to Flummox.
  • Generate action ids.
  • Supports actions with decorators, promises, and therefore ES7 async.
@chantastic
chantastic / on-jsx.markdown
Last active May 22, 2026 08:30
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't