Skip to content

Instantly share code, notes, and snippets.

View koolamusic's full-sized avatar
🎯
Focusing

BLS12381 koolamusic

🎯
Focusing
View GitHub Profile
@koolamusic
koolamusic / .htaccess
Created March 7, 2018 16:19
HTACCESS TRAILING SLASH
# STACKOVERFLOW
Options -Multiviews
RewriteEngine On
RewriteBase /
#Remove .html extension
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ %1/ [NC,L,R]
RewriteCond %{REQUEST_FILENAME} !-d
@koolamusic
koolamusic / angular.md
Last active April 20, 2018 20:09
Deploying Angular Projects to gh-pages

STEP 1

Type this into the terminal

ng build --prod --output-path docs --base-href PROJECT_NAME

  • where PROJECT_NAME is the name of your project in GitHub. Make a copy of docs/index.html and name it docs/404.html.
  • Commit your changes and push. On the GitHub project page, configure it to publish from the docs folder.

ALTERNATIVE SUBTREE PUSH

@koolamusic
koolamusic / gitlfs.md
Last active April 24, 2018 13:03
Git Large File Storage quickstart

Download and install the Git command line extension. You only have to set up Git LFS once.

git lfs install

Select the file types you'd like Git LFS to manage (or directly edit your .gitattributes). You can configure additional file extensions at anytime.

git lfs track "*.psd"

Make sure .gitattributes is tracked

@koolamusic
koolamusic / wp-start.sh
Created May 30, 2018 20:47 — forked from ethicka/wp-start.sh
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
#!/bin/bash -e
##
# WordPress Installation and VirtualHost Creation
#
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage,
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks,
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes,
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress
@koolamusic
koolamusic / .apache_htaccess
Created August 29, 2018 05:46
Block hidden files except .well-known - Apache .htaccess + Nginx Prevent .git vuln
RewriteRule "(^|/)\.(?!well-known\/)" - [F]
@koolamusic
koolamusic / githook.php
Created August 29, 2018 06:45
Php Git Webhook to execute git pull command on server when called
<?php
// initial exec using backtick
//`git pull`;
// set new output using shell_exec
// add shell exec for dbDump
$output = shell_exec('git pull');
echo "<pre>$output</pre>";
?>
@koolamusic
koolamusic / app.js
Created August 30, 2018 09:56
Learn React From Scratch
"use strict";
console.log("App.js is running");
const template = React.createElement(
"div",
null,
React.createElement(
"h1",
{ id: "food", className: "runtime" },
@koolamusic
koolamusic / node.sh
Created October 23, 2018 21:50
Bash Script to Setup NodeJS and Nginx on Ubuntu16 LTS and Ubuntu14.04
#!/bin/bash
NODE_VERSION=0.3.1
NODE_FILE=node-v$NODE_VERSION
MY_USER=anatoliy
REDIS_VERSION=2.0.3
apt-get update
apt-get install -y build-essential git-core nginx libssl-dev pkg-config
wget http://nodejs.org/dist/$NODE_FILE.tar.gz
@koolamusic
koolamusic / disqus.html
Created January 25, 2019 09:51 — forked from Soreine/disqus.html
Jekyll include file to integrate disqus comments.
{% if site.disqus_short_name and page.comments != false %}
<div id="disqus_thread"></div>
<script>
var disqus_shortname = '{{ site.disqus_short_name }}';
var disqus_config = function () {
// _config.yml should define the site's URL
this.page.url = '{{ site.url }}{{ page.url }}';
// Using an optional disqus_identifier variable, or the site.url + page.id combination
this.page.identifier = '{% if page.disqus_identifier %}{{ page.disqus_identifier}}{% else %}{{ site.url }}{{ page.id }}{% endif %}';
};
@koolamusic
koolamusic / .htaccess
Created May 23, 2019 16:02
Bedrock htaccess
# VARIANT TWO
RewriteEngine on
# Change root directory to "web" folder
RewriteCond %{THE_REQUEST} ^GET\ /web/
RewriteRule ^web/(.*) /$1 [L,R=301]
RewriteRule !^web/ web%{REQUEST_URI} [L]