Skip to content

Instantly share code, notes, and snippets.

View khoerodin's full-sized avatar
:octocat:
Meow everyday

khoerodin

:octocat:
Meow everyday
View GitHub Profile
@khoerodin
khoerodin / private_fork.md
Created September 2, 2023 10:36 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@khoerodin
khoerodin / hasClass.js
Created October 2, 2017 03:43 — forked from sonnyt/gist:8585696
JavaScript Check If Element Has Class
function hasClass(element, className) {
return element.className && new RegExp("(^|\\s)" + className + "(\\s|$)").test(element.className);
}
var myDiv = document.getElementById('MyDiv');
hasClass(myDiv, 'active');
// OR
@khoerodin
khoerodin / getProperty.js
Created July 28, 2017 08:57 — forked from jasonrhodes/getProperty.js
Get a nested object property by passing a dot notation string as the property name
/**
* A function to take a string written in dot notation style, and use it to
* find a nested object property inside of an object.
*
* Useful in a plugin or module that accepts a JSON array of objects, but
* you want to let the user specify where to find various bits of data
* inside of each custom object instead of forcing a standardized
* property list.
*
* @param String nested A dot notation style parameter reference (ie "urls.small")
@khoerodin
khoerodin / xdebug_php.ini
Created April 28, 2017 03:17 — forked from birchestx/xdebug_php.ini
xdebug settings in php.ini
[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
@khoerodin
khoerodin / phpstorm64.vmoptions
Created March 30, 2017 01:56
PHP Storm - Better font rendering on Ubuntu, How to adjust vmoptions
-Dawt.useSystemAAFontSettings=on
-Dswing.aatext=true
-Dsun.java2d.xrender=true
@khoerodin
khoerodin / jekyll-and-liquid.md
Created February 24, 2017 01:21 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@khoerodin
khoerodin / concat.liquid
Created February 24, 2017 01:20 — forked from BryanSchuetz/concat.liquid
Concat arrays in Jekyll(liquid)
{% assign all_hosts = "" | split: "" %}
{% for host in site.data.shared_hosts %}
{% assign all_hosts = all_hosts | push: host %}
{% endfor %}
{% for host in site.data.paas_hosts %}
{% assign all_hosts = all_hosts | push: host %}
{% endfor %}
@khoerodin
khoerodin / Laravel PHP7 LEMP AWS.md
Created January 25, 2017 04:06 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 14.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@khoerodin
khoerodin / Virtual Blocks on Nginx.md
Created January 25, 2017 03:41 — forked from santoshachari/Virtual Blocks on Nginx.md
Setup additional sites on Nginx

Inspired and edited from this Digital Ocean tutorial.

Follow the steps on this gist to setup a LEMP stack with PHP 7.0.

The steps assume Nginx has been configured correctly.

Setup the root directories

For the domains example.com and test.com, create the folders.

Modifying an Existing Docker Image

To install a custom package or modify an existing docker image we need to

  1. run a docker a container from the image we wish to modify
  2. modify the docker container
  3. commit the changes to the container as a docker image
  4. test changes made to image

1.) Running a docker container from an image