Skip to content

Instantly share code, notes, and snippets.

View matheushf's full-sized avatar
🚀

Matheus Victor matheushf

🚀
View GitHub Profile
@bahmutov
bahmutov / README.md
Last active October 4, 2023 08:35
Single command to run Node with local file access

Goal: run a simple NodeJS application inside a Docker container

Subgoal: give it access to local files.

docker run -it --rm --name example -v "$PWD":/usr/src/app -w /usr/src/app node:5-slim node index.js

output:

@bahmutov
bahmutov / Docker shell commands.sh
Last active February 9, 2024 07:55
A personal cheat sheet for running local Node project in a Docker container
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .
@anvaka
anvaka / 00.Intro.md
Last active April 20, 2025 21:16
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
@reggiegutter
reggiegutter / regex_celular.php
Created May 4, 2013 05:53
Regular expression (Regex) para validar números de telefones celulares para o Brasil, incluindo os novos números de celulares para São Paulo - que agora possuem o número 9 no início da primeira seção após o DDD (Exemplo: (11) 92222-2222).
<?php
// Função para checar número de telefone
function phone_check($phone)
{
$exp_regular = '/^(\(11\) (9\d{4})-\d{4})|((\(1[2-9]{1}\)|\([2-9]{1}\d{1}\)) [5-9]\d{3}-\d{4})$/';
$ret = preg_match($exp_regular, $phone);
if($ret === 1)
{
@glennblock
glennblock / fork forced sync
Created March 4, 2012 19:27
Force your forked repo to be the same as upstream.
git fetch upstream
git reset --hard upstream/master