Skip to content

Instantly share code, notes, and snippets.

View omarqe's full-sized avatar
👨‍💻
Focusing

Omar Mokhtar omarqe

👨‍💻
Focusing
View GitHub Profile

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@omarqe
omarqe / markdown.md
Created April 17, 2018 10:02 — forked from jonschlinkert/markdown-cheatsheet.md
A better markdown cheatsheet. I used Bootstrap's Base CSS documentation as a reference.

Typography

Headings

Headings from h1 through h6 are constructed with a # for each level:

# h1 Heading
## h2 Heading
### h3 Heading
@omarqe
omarqe / 0.autoload_setup.php
Created April 5, 2018 07:33 — forked from mhull/0.autoload_setup.php
A basic PHP autoloader setup
<?php
/**
* In this example, we are autoloading classes within the namespace `Acme\ExampleProject`. The file `index.php` is the
* entry point to our project; and we are using the `src` directory to store and organize our PHP class files. Our
* autoloader is located in `autoload.php`
*
* The basic behavior is illustrated in the fact that PHP will autoload the file `src/mammals/human.php` whenever we
* attempt to create a `new \Acme\ExampleProject\Mammals\Human` anywhere in our project's codebase.
*
* This diagram illustrates our project structure. Each file's contents can be found below.
@omarqe
omarqe / app.js
Created March 26, 2018 01:58 — forked from anandgeorge/app.js
Socket.io example with jquery and dom manipulation
var io = require('socket.io').listen(8000),
nicknames = {};
io.sockets.on('connection', function (socket) {
socket.on('user message', function (msg) {
socket.broadcast.emit('user message', socket.nickname, msg);
});
socket.on('nickname', function (nick, fn) {
if (nicknames[nick]) {
@omarqe
omarqe / index.php
Created January 30, 2018 13:20 — forked from oriolrivera/index.php
Simple Chat Using WebSocket and PHP Socket
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8' />
<style type="text/css">
<!--
.chat_wrapper {
width: 500px;
margin-right: auto;
margin-left: auto;
@omarqe
omarqe / php-html-css-js-minifier.php
Created March 20, 2017 07:51 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
// Based on <https://github.com/mecha-cms/extend.minify>
define('MINIFY_STRING', '"(?:[^"\\\]|\\\.)*"|\'(?:[^\'\\\]|\\\.)*\'');
define('MINIFY_COMMENT_CSS', '/\*[\s\S]*?\*/');
define('MINIFY_COMMENT_HTML', '<!\-{2}[\s\S]*?\-{2}>');
define('MINIFY_COMMENT_JS', '//[^\n]*');
define('MINIFY_PATTERN_JS', '\b/[^\n]+?/[gimuy]*\b');
define('MINIFY_HTML', '<[!/]?[a-zA-Z\d:.-]+[\s\S]*?>');