Skip to content

Instantly share code, notes, and snippets.

View fiveisprime's full-sized avatar
🖤

Matt Hernandez fiveisprime

🖤
View GitHub Profile
@fiveisprime
fiveisprime / Dockerfile
Created January 22, 2024 21:45
Vite in Docker
FROM node:lts-alpine
WORKDIR /usr/src/app
COPY package*.json, .
RUN npm install --silent && mv node_modules ../
COPY . .
EXPOSE 5173
RUN chown -R node /usr/src/app
USER node
CMD ["npm", "run", "dev"]
# Base
FROM node:8.11.3-alpine AS base
WORKDIR /usr/src/app
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
# Dependencies
FROM base AS dependencies
RUN npm install --production --silent
RUN cp -R node_modules prod_node_modules
RUN npm install --silent
@fiveisprime
fiveisprime / Dockerfile
Last active February 5, 2018 23:04
Angular custom image deployment to Azure
FROM nginx:stable-alpine
ADD dist /usr/share/nginx/html
ADD default.conf /etc/nginx/conf.d/
@fiveisprime
fiveisprime / upload.js
Created January 5, 2018 16:43
Upload solution for makemehapi
(async () => {
try {
const Hapi = require('hapi');
const server = new Hapi.Server({
host: 'localhost',
port: Number(process.argv[2] || 8080)
});
server.route({
method: 'POST',
@fiveisprime
fiveisprime / readme.md
Created April 4, 2016 20:32
Meteor on Modulus

Cross-platform Meteor

This document explains how cross-platform meteor apps work and how to compile them to run on Modulus.

Cordova

Projects setup to compile for multiple platforms (ios and android) will need to compile the client assets into a bundle for those platforms using Cordova as part of the meteor build step. This step must be done on OSX on your local

@fiveisprime
fiveisprime / quick-start
Last active October 23, 2015 15:26
Modulus Meteor Quickstart
$ meteor create --example leaderboard
$ cd leaderboard
$ modulus project create leaderboard -r node.js -s 512
$ modulus env set ROOT_URL $(modulus project list | grep leaderboard | awk '{print $4}') -p leaderboard
$ modulus addons add mongo:base -p leaderboard
$ modulus deploy -p leaderboard
var Fiber = require("fibers");
var fs = require("fs");
var path = require("path");
var Future = require("fibers/future");
var _ = require('underscore');
var sourcemap_support = require('source-map-support');
var bootUtils = require('./boot-utils.js');
var files = require('./mini-files.js');
@fiveisprime
fiveisprime / reconnect.js
Created June 8, 2015 13:33
Reconnect on error with mongoose.
db.on('error', function(error) {
console.error('Error in MongoDb connection: %j', error);
mongoose.disconnect();
});
db.on('disconnected', function() {
console.log('MongoDB disconnected!');
mongoose.connect(config.mongo.uri, config.mongo.options);
});
#!/usr/bin/env ruby
# encoding: UTF-8
# Copyright © 2009 Caio Chassot
# Licensed under the WTFPL
def alternation(*s); s.map(&Regexp.method(:escape)).join("|") end
# All input is read here.
LINES = $stdin.readlines
IS_SELECTION = ENV.key?("TM_SELECTED_TEXT")
@fiveisprime
fiveisprime / grid.css
Created February 27, 2015 16:26
Basic CSS grid system.
/* Full width */
.grid_1 { width: 6.5%; }
.grid_2 { width: 15%; }
.grid_3 { width: 23.5%; }
.grid_4 { width: 32%; }
.grid_5 { width: 40.5%; }
.grid_6 { width: 49%; }
.grid_7 { width: 57.5%; }
.grid_8 { width: 66%; }