Skip to content

Instantly share code, notes, and snippets.

View marcusoftnet's full-sized avatar

Marcus Hammarberg marcusoftnet

View GitHub Profile
@marcusoftnet
marcusoftnet / demo.sh
Created August 26, 2021 12:07
Bash challenge from real life - part I; which licenses are used in all our code, including dependencies
#!/usr/bin/env zsh
# The challenge is to understand which licenses we are indirectly including, by just getting a list of tool and license
# I'm thinking to post process this later, summarizing, sorting and aggregating in Google Sheets.
# For now I just want to get a list
# This assumest that all relevant repositories to be local directory in the current folder.
## Part I - install all dependencies for all repositories (i.e. all subfolders one level deep from .)
# Employee records
- martin:
name: Martin D'vloper
job: Developer
skills:
- python
- perl
- pascal
- tabitha:
name: Tabitha Bitumen
{
"context" : {
"path" : "/user",
"method" : "POST"
},
"userId": "123",
"name": "Marcus Hammarberg",
"age": "43"
}
@marcusoftnet
marcusoftnet / anAttemptToResolve.js
Last active February 27, 2016 11:20
Promises... Aaaaah
/*global require, module*/
var ApiBuilder = require('claudia-api-builder'),
api = new ApiBuilder(),
Promise = require('bluebird');
module.exports = api;
// use a promise for asynchronous processing
api.get('/greet/{name}', function(request) {
'use strict';
@marcusoftnet
marcusoftnet / test.config.js
Created February 23, 2015 03:45
Testing config
var should = require("should");
describe("Configuration", function() {
var validateConfig = function(config) {
should.exists(config.mode);
config.mode.should.not.be.emtpy;
should.exists(config.mongoUrl);
config.mongoUrl.should.not.be.emtpy;
@marcusoftnet
marcusoftnet / config
Created February 23, 2015 01:35
Config object
var mongoProdUri = process.env.MONGOLAB_URI || 'localhost:27017/myApp_Prod';
var adminUser = {
name : process.env.BASIC_USER || 'marcus',
pass : process.env.BASIC_PASS || 'koavote'
};
var config = {
local: {
mode: 'local',
@marcusoftnet
marcusoftnet / scaffold_post
Last active July 7, 2016 22:57
Jekyll Post Scaffolder
#!/bin/bash
#---------/---------------------\---------#
#--------|- Jekyll Post Creator -|--------#
#---------\---------------------/---------#
# Ripped and tweaked from https://gist.github.com/kabrooski/6107707
# Simply put the script in your site directory, edit the configs to fit your setup, and run it with:
# ./post "post title"
@marcusoftnet
marcusoftnet / makeReleaseNumber
Created June 19, 2014 13:02
function for setting next release number
BIN = ./node_modules/.bin
define release
VERSION=`node -pe "require('./package.json').version"` && \
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \
node -e "\
var j = require('./package.json');\
j.version = \"$$NEXT_VERSION\";\
var s = JSON.stringify(j, null, 2);\
require('fs').writeFileSync('./package.json', s);" && \
@marcusoftnet
marcusoftnet / maketestkoa
Created June 19, 2014 13:01
Makefile test task for Koa and Mocha
BIN = ./node_modules/.bin
.PHONY: test
test:
@$(BIN)/mocha \
--harmony-generators \
-u bdd \
-R dot \
-b
@marcusoftnet
marcusoftnet / makefileKwitansi
Created June 19, 2014 13:00
Total Make file
BIN = ./node_modules/.bin
define release
VERSION=`node -pe "require('./package.json').version"` && \
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \
node -e "\
var j = require('./package.json');\
j.version = \"$$NEXT_VERSION\";\
var s = JSON.stringify(j, null, 2);\
require('fs').writeFileSync('./package.json', s);" && \