Skip to content

Instantly share code, notes, and snippets.

View synsa's full-sized avatar

Steve Lang synsa

View GitHub Profile
@synsa
synsa / Capfile
Created April 28, 2019 08:24 — forked from mashihua/Capfile
Capistrano deploy script for node.js
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
load 'config/node'
@synsa
synsa / A Nuxt.js VPS production deployment.md
Created April 28, 2019 08:28 — forked from DreaMinder/A Nuxt.js VPS production deployment.md
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.

UPD: This manual now compatible with [email protected]. For older versions deployment, see revision history.


Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

directoryWalker: (dir, callback, maxLevels, currentLevel, fromRoot) ->
maxLevels: if 'number' is typeof maxLevels then maxLevels else 0
currentLevel: if 'number' is typeof currentLevel then currentLevel else 1
fromRoot: if 'string' is typeof fromRoot then fromRoot else ''
fs.readdir dir, (error, files) ->
if error then puts error.message
else files.forEach (file) ->
fs.stat path.join(dir, file), (error, stats) ->
return puts error.message if error
@synsa
synsa / browsersync-webpack.md
Created May 16, 2019 20:04 — forked from robinrendle/browsersync-webpack.md
Getting set up with Browsersync and Webpack

Fixing our local environment with Browsersync

Whenever we change our templates we still have to use our build script and this can get annoying. Thankfully with webpack-dev-server and BrowserSync we can fix this:

npm i -D browser-sync browser-sync-webpack-plugin webpack-dev-server

BrowserSync will act like a proxy, waiting for webpack to do its thing and then reloading the browser for us.

@synsa
synsa / autocomplete.vue
Created May 31, 2019 19:56 — forked from sryabov/autocomplete.vue
vuetify autocomplete component example
<template>
<v-autocomplete
v-model="select"
:loading="loading"
:items="items"
:search-input.sync="search"
no-filter
hide-selected
clearable
return-object
@synsa
synsa / personal.rc
Created June 6, 2019 18:36 — forked from kitchen/personal.rc
sample mutt configuration
# me
set realname = "Jeremy Kitchen"
set from = "[email protected]"
set envelope_from = yes
# personal account info
set imap_user = "[email protected]"
set imap_pass = "REDACTED"
set folder = imaps://imap.gmail.com/
set smtp_url = smtps://[email protected]@smtp.gmail.com/
@synsa
synsa / git-aware-bash-prompt.md
Created June 28, 2019 21:57 — forked from eliotsykes/git-aware-bash-prompt.md
Git Aware Bash Prompt
@synsa
synsa / .BASH-PROMPT.png
Created June 28, 2019 22:00 — forked from kfcobrien/.BASH-PROMPT.png
Clean informative bash prompt with git info
.BASH-PROMPT.png
@synsa
synsa / jsonToSqlite.py
Created July 15, 2019 19:09 — forked from atsuya046/jsonToSqlite.py
create sqlite database file from json file
# -*- coding:utf-8 -*-
import json
import sqlite3
JSON_FILE = "some.json"
DB_FILE = "some.db"
traffic = json.load(open(JSON_FILE))
conn = sqlite3.connect(DB_FILE)