Skip to content

Instantly share code, notes, and snippets.

View BrianSeng's full-sized avatar
🤟

Brian Sengsourichanh BrianSeng

🤟
View GitHub Profile
@BrianSeng
BrianSeng / get-npm-package-version
Created January 20, 2022 00:30 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@BrianSeng
BrianSeng / model-user.js
Created May 15, 2019 16:14 — forked from lucasscariot/model-user.js
Composite Primary Key in Sequelize
/*
* Migration
*/
'use strict';
module.exports = {
up: function(queryInterface, Sequelize) {
return queryInterface.createTable('Users', {
firstName: {
type: Sequelize.STRING
},
@BrianSeng
BrianSeng / travelLeg.factory.js
Last active December 5, 2017 16:45
Messing with js based "classes" & prototypal inheritance in AngularJS
(function ()
{
"use strict";
angular
.module('request.travelLegs')
.factory('TravelLeg', function ()
{
let TravelLeg = function (data)
{