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)
# 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())

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@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
[TestClass]
public static class Initializer
{
[AssemblyInitialize]
public static void InitFactories(TestContext context)
{
var factoryTypes = Assembly.GetExecutingAssembly()
.GetTypes().Where(x => x.Name.EndsWith("Factory"))
.ToList();
@valentinzberea
valentinzberea / about.md
Created August 9, 2011 13:42 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer