Skip to content

Instantly share code, notes, and snippets.

View danielchikaka's full-sized avatar

Daniel Chikaka danielchikaka

View GitHub Profile
@danielchikaka
danielchikaka / post.md
Created June 7, 2016 08:39 — forked from kbond/post.md
Ubuntu LAMP Development Environment Setup

Install git:

sudo apt-get install git

Configure Git:

touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"

git config --global user.email "Your Email"

@danielchikaka
danielchikaka / laravel-query-many-to-many-relationship.md
Created June 15, 2017 07:44 — forked from aquasmit/laravel-query-many-to-many-relationship.md
Laravel - Eloquent - query many to many relationship

Laravel - Eloquent - query many to many relationship

Example:

Table 1: posts

Table 2: categories

Pivot Table: category_post with foreign keys category_id, post_id

@danielchikaka
danielchikaka / global-variables-are-bad.js
Created August 2, 2017 05:18 — forked from hallettj/global-variables-are-bad.js
How and why to avoid global variables in JavaScript
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {
var defaults = {
number: 1,
bool: true,
magic: 'real',
animal: 'whale',
croutons: 'delicious'
};
var options = {
number: 2,
@danielchikaka
danielchikaka / app.js
Created August 28, 2018 15:16 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');