Skip to content

Instantly share code, notes, and snippets.

View djom202's full-sized avatar

Jonathan Olier djom202

View GitHub Profile
@djom202
djom202 / run-test-build-and-deploy.sh
Created October 31, 2017 16:28 — forked from EstebanMDQ/run-test-build-and-deploy.sh
run gulp build in codeship and deploy that to heroku
gulp test
gulp build
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git add build
git commit -am "app built"
export CI_COMMIT_ID=$(git rev-parse HEAD)
@djom202
djom202 / index.js
Created November 17, 2017 19:53 — forked from max-mapper/index.js
requirebin sketch
var observer = require('continuous-observer')
var cave = require('cave-automata-2d')
var fill = require('ndarray-fill')
var zero = require('zeros')
var raf = require('raf')
var canvas = document.createElement('canvas')
var ctx = canvas.getContext('2d')
// Set up the controls, so that we can control
@djom202
djom202 / bitbucket-pipelines.yml
Created February 18, 2019 13:58 — forked from thesabbir/bitbucket-pipelines.yml
Bitbucket pipeline example for JS projects
image: node:7.0 #node v7
clone: # the 'clone' section
depth: 1 # latest commit only
pipelines:
default:
- step:
script:
- npm i -g yarn
- yarn
@djom202
djom202 / Nested-Routers-Express.md
Created May 13, 2019 14:21 — forked from zcaceres/Nested-Routers-Express.md
Child Routers in Express

Nested Routers in Express.js

Express makes it easy to nest routes in your routers. But I always had trouble accessing the request object's .params when you had a long URI with multiple parameters and nested routes.

Let's say you're building routes for a website www.music.com. Music is organized into albums with multiple tracks. Users can click to see a track list. Then they can select a single track and see a sub-page about that specific track.

At our application level, we could first have a Router to handle any requests to our albums.

const express = require('express');
@djom202
djom202 / dijkstra.js
Created July 29, 2019 21:17 — forked from nybblr/dijkstra.js
Dijkstra's Algorithm in JavaScript.
var graph = [
'AB6',
'AC3',
'BD6',
'CD5',
'CE9',
'DF8',
'DE3',
'EG8',
'FG2'
@djom202
djom202 / jenkins-set-number-of-executors.groovy
Created October 31, 2019 20:27 — forked from ivan-pinatti/jenkins-set-number-of-executors.groovy
Jenkins - Set number of executors via groovy script - #jenkins #groovy
#!groovy
// imports
import jenkins.model.Jenkins
// parameter
Integer numberOfExecutors = 2
// get Jenkins instance
Jenkins jenkins = Jenkins.getInstance()
@djom202
djom202 / gist:c190a1668a11c14d0328dcdc79a42da0
Created October 27, 2020 01:33 — forked from timonweb/gist:3165322
Code to catch all PHP errors which result in 500 Error Code. Include this snippet at the beginning of index.php file
<?php
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR |
E_COMPILE_ERROR | E_RECOVERABLE_ERROR);
define('ENV', 'dev');
//Custom error handling vars
define('DISPLAY_ERRORS', TRUE);
define('ERROR_REPORTING', E_ALL | E_STRICT);