Skip to content

Instantly share code, notes, and snippets.

View Joaquin6's full-sized avatar
🏠
Working from home

Joaquin Briceno Joaquin6

🏠
Working from home
  • Overland Park, KS
View GitHub Profile
@Joaquin6
Joaquin6 / nested_flatten_array_example.js
Created September 28, 2016 09:30
Flatten an array of arbitrarily nested arrays of integers into a flat array of integers in Node.js.
var _ = require("underscore");
var nestedArray = [[1,2,[3]],4];
var flattenArray = _.flatten(nestedArray);
console.log(flattenArray);
// => [1, 2, 3, 4]
@Joaquin6
Joaquin6 / syscolors.js
Created January 14, 2017 11:55
Colors reference of text to command when running node.js application
const util = require('util')
module.exports = {
Reset: "\x1b[0m",
Bright: "\x1b[1m",
Dim: "\x1b[2m",
Underscore: "\x1b[4m",
Blink: "\x1b[5m",
Reverse: "\x1b[7m",
Hidden: "\x1b[8m",
@Joaquin6
Joaquin6 / Bash-Profile
Last active January 26, 2017 11:32
Example file that holds all my BASH configurations and aliases on MAC
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@Joaquin6
Joaquin6 / add-issue-id-hook
Last active January 26, 2017 06:41
Git-Hooks Hooks created to enhance work day progress and productivity. Available Features: Take control of the git templates in your project by adding a hidden folder called '.git_template' at the root of your directory. Customize the final commit messages.
#!/usr/bin/env python
# add-issue-id-hook version 1.1.0
#
# Created by Joaquin Briceno
# https://github.com/pbetkier/add-issue-id-hook
# customize the final commit message using placeholders:
# - {issue_id} replaced with discovered issue id
# - {user_message} replaced with message provided by the user
Short description of commit
Longer explanation of the motivation for the change
Fixes-Bug: Enter bug-id or delete line
Implements-Requirement: Enter requirement-id or delete line
@Joaquin6
Joaquin6 / .bash_profile
Created January 21, 2017 00:15
This file holds all my BASH configurations and aliases
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@Joaquin6
Joaquin6 / post-merge
Created January 25, 2017 14:27
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@Joaquin6
Joaquin6 / git-jira-hook
Created January 26, 2017 05:39
This is a git hook, to be used in an environment where git is used and jira as the project Task Tracking System. This hook allows us to (for lack of a better word) 'force' developers into an organized set of habits that provide proper project documentation and task details.
#!/usr/bin/env python
##########################################################################
# Copyright 2009 Broadcom Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@Joaquin6
Joaquin6 / git-jira-hook-rest
Created January 26, 2017 06:04
This is a git hook, to be used in an environment where git is used as the source control and Jira is used for bug tracking.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Max Oberberger (max@oberbergers.de)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@Joaquin6
Joaquin6 / add-issue-id-hook
Created January 26, 2017 06:12
Customize the final commit message using placeholders: - {issue_id} replaced with discovered issue id - {user_message} replaced with message provided by the user commit_message_format = '{issue_id} {user_message}'. Set this to a custom JIRA project key format or explicitly specify a single project name, e.g. 'EXAMPLE' project_format = '[A-Z][A-Z…
#!/usr/bin/env python
# add-issue-id-hook version 1.1.0
#
# Created by Joaquin Briceno
# https://github.com/pbetkier/add-issue-id-hook
# customize the final commit message using placeholders:
# - {issue_id} replaced with discovered issue id
# - {user_message} replaced with message provided by the user