Skip to content

Instantly share code, notes, and snippets.

View valentinzberea's full-sized avatar

Valentin Zberea valentinzberea

View GitHub Profile
@valentinzberea
valentinzberea / Dockerfile
Created November 6, 2023 09:19 — forked from malteneuss/Dockerfile
Nextjs + Prisma DB (query and migrations) in Docker
# Adapted from https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
# Install dependencies only when needed
FROM node:16-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# Rebuild the source code only when needed
@valentinzberea
valentinzberea / README.md
Created April 7, 2018 18:53 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

Keybase proof

I hereby claim:

  • I am valentinzberea on github.
  • I am valentinzberea (https://keybase.io/valentinzberea) on keybase.
  • I have a public key ASB_g-Dy7WNRscrgQMjLEk7QqT61Y_ft3NKNUULFTT-Rxgo

To claim this, I am signing this object:

@valentinzberea
valentinzberea / counter.py
Created April 11, 2016 11:30
Counting number of appearances
from collections import Counter
from random import randint
v = [randint(1, 10) for i in range(100)]
c = Counter(v)
for el in c.most_common():
print(el)
@valentinzberea
valentinzberea / game.py
Last active November 25, 2015 15:52
Game exercise from LPTHW by Ionut
import random
pocket_list = []
table_phrase = "You put it in your pocket. "
def table_book():
mkdir -p ~/.docker
brew cask install dockermachine
docker-machine create --driver virtualbox default
@valentinzberea
valentinzberea / craft-conf-2015
Created April 10, 2015 15:06
Talk selection for Craft Conf 2015
THEO SCHLOSSNAGLE (Circonus) - Techniques and tools for a coherent discussion about performance in complex architectures
MITCHELL HASHIMOTO (Hashicorp) - Automating the Modern Datacenter, Development to Production
MARTIN KLEPPMANN (LinkedIn) - Using logs to build a solid data infrastructure
CAITIE MCCAFFREY (Twitter) - Implementing the Saga Pattern
TAMMER SALEH (Pivotal) - Microservice AntiPatterns
PAUL BUTCHER (Ten Tenths Consulting, Pragmatic Programmers) - Concurrency: It's harder (and easier) than you think
JEREMY EDBERG (Netflix) - Building Reliable Distributed Data Systems
COREY HAINES (CoreyHaines) - Fun with the lambda calculus
DAVID NOLEN (Cognitect) - The Front End Architecture Revolution
MICHAEL NYGARD (Cognitect) - Architecture without an end state
<!doctype html>
<meta charset="utf-8" />
<title>React Router Boilerplate<style id="jsbin-css">
.crumbs li {
display: inline-block;
margin-left: 10px;
}
</style>
</title>
<body>
@valentinzberea
valentinzberea / pre-commit
Last active August 29, 2015 13:56
Pre-commit hook for coffeescript-jshint
git diff --staged --name-only | xargs coffee-jshint -g define,$,_,setTimeout,start,window
if [[ $? -ne 0 ]]; then
echo 'WARNING: You are about to commit files with coffee-jshint warnings'
exit 1
fi
# 1. Initialization code:
logged_user = window.user
# Properties for each event
mixpanel.register(
'User Account': logged_user.getUserAccount()
'Whitelabel': logged_user.getUserType()
)
# People settings
mixpanel.name_tag(logged_user.getNameTag())