Skip to content

Instantly share code, notes, and snippets.

View hc3's full-sized avatar
🎯
Focusing

Eliel hc3

🎯
Focusing
View GitHub Profile
@hc3
hc3 / [FEDORA] gitkraken
Created February 1, 2018 01:14 — forked from aelkz/[FEDORA] gitkraken
How to install gitkraken on Fedora 25 + launcher icon
#!/bin/bash
# Download GitKraken
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
# copy the downloaded file into /opt directory
cp gitkraken-amd64.tar.gz /opt/gitkraken
cd /opt
@hc3
hc3 / app.js
Created January 25, 2018 18:13 — forked from anandgeorge/app.js
Socket.io example with jquery and dom manipulation
var io = require('socket.io').listen(8000),
nicknames = {};
io.sockets.on('connection', function (socket) {
socket.on('user message', function (msg) {
socket.broadcast.emit('user message', socket.nickname, msg);
});
socket.on('nickname', function (nick, fn) {
if (nicknames[nick]) {
@hc3
hc3 / mysql.js
Created November 10, 2017 14:21 — forked from higordiego/mysql.js
const Sequelize = require('sequelize')
const fs = require('fs')
const path = require('path')
let database = null
const loadModels = (sequelize) => {
const dir = path.join(__dirname, '../modules/models')
const models = []

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)