Skip to content

Instantly share code, notes, and snippets.

View NorthDecoder's full-sized avatar

Joe Devlin NorthDecoder

View GitHub Profile
@NorthDecoder
NorthDecoder / hzrule.js
Last active March 11, 2016 10:27
HZRULE - Dividing rule string xN
/** # hzrule.js
/^[v^~=*+]/ match any of these characters
at begining of msg for the ruler
Return the match multiplied by the length of
the input string x 5. If no match return the
original msg string.
Usage:
@NorthDecoder
NorthDecoder / Jasmine_SpecRunner.html
Last active April 10, 2018 20:26
Jasmine TDD specification runner html template
<!DOCTYPE html>
<html>
<head>
<title>Jasmine SpecRunner</title>
<!-- https://jasmine.github.io/ -->
<meta charset="utf-8">
<!-- cdnjs.cloudflare.com -->
<!-- Jasmine -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jasmine/3.1.0/jasmine.min.css"/>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jasmine/3.1.0/jasmine.min.js"></script>
@NorthDecoder
NorthDecoder / Install-NodeJS.sh
Created February 24, 2017 09:44
Installing nodeJS for a single user
#!/bin/bash
# File: Install-NodeJS.sh
# Desc: A script to install NodeJS in a subdirectory named node_v
# on a server.
# License: [MIT](https://mit-license.org/)
# Usage:
@NorthDecoder
NorthDecoder / enable_drupal_modules.sh
Last active October 4, 2017 21:53
Enable Drupal 7 modules and themes with Drush commnads
#!/bin/bash
# #####################################
# filename: enable_drupal_modules.sh
# Enable Drupal 7 modules and themes with
# http://www.drushcommands.com/drush-7x/pm/pm-enable
# Before enabling the modules, the drupal installation
# and setup must be done for example with my script
@NorthDecoder
NorthDecoder / extend_an_object.js
Created November 18, 2017 22:52
Extend a javascript object
function extend(destination, source) {
for (var property in source) destination[property] = source[property];
return destination;
}
@NorthDecoder
NorthDecoder / Connecting_to_MongoDB_thru_Loopback.md
Last active March 30, 2018 23:50
Loopback connected to Compose MongoDB, with detailed credentials configuration in an NVM defined node version on C9.io

Connecting to MongoDB thru loopback

Installing loopback in a c9.io workspace

As a prerequisite to loopbackjs 3.x.x make sure the version of nodejs is updated to >= 4.x.

node -v  # check current node version
npm -v   # check current node package manager version
@NorthDecoder
NorthDecoder / install_drupal_8_modules.sh
Last active April 12, 2018 21:00
Drupal 8.5.1 module and theme installation with drush commands
#!/bin/bash
# Installation of Drupal, modules and themes with drush commands
# from http://www.drushcommands.com/drush-7x/pm/pm-download
# Specific revisions of each module are installed. Research each
# module to confirm that you are installing the lastest revision.
# Instructions for installation
# SFTP this file into your installation directory
@NorthDecoder
NorthDecoder / enable_drupal_8_modules.sh
Last active April 12, 2018 21:55
Enable Drupal 8 modules and themes with Drush commnads
#!/bin/bash
# THIS VERSION PERMANENTLY CRASHES WEBSITE!
# EXPERIMENTAL ONLY - USE AT YOUR OWN RISK.
# #####################################
# filename: enable_drupal_modules.sh
# Enable Drupal 8 modules and themes with
# https://drushcommands.com/drush-9x/pm/pm:enable/
@NorthDecoder
NorthDecoder / install-concrete5-latest.sh
Last active May 7, 2019 20:01
Install CMS Concrete 5 from the command line
#!/bin/bash
# filename: install_concrete5.sh
# License: https://mit-license.org/
# For installing CMS [concrete5](https://www.concrete5.org/) from
# the command line.
# Usage:
# ------
@NorthDecoder
NorthDecoder / check-directory.sh
Created August 17, 2018 20:33
Check for the existence of a directory, or check in the directory is in the PATH variable
#!/bin/bash
# filename: check-directory.sh
clear
# - - - - - - - - - - - - - - - - - -
function dirInPATH () {
# Inputs: expect a single directory
# Output: true if in the PATH
# false if not in the PATH