Skip to content

Instantly share code, notes, and snippets.

Daniel Chikaka danielchikaka

Block or report user

Report or block danielchikaka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
danielchikaka / app.js
Created Aug 28, 2018 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
View app.js
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.get('/', function(req, res) {
View example.js
var defaults = {
number: 1,
bool: true,
magic: 'real',
animal: 'whale',
croutons: 'delicious'
var options = {
number: 2,
View jsbin.gewozekoxi.js
function todayDate(){
var day;
switch(new Date().getDay()){
case 0:
day = "Sunday";
case 1:
day = "Monday";
case 2:
danielchikaka / global-variables-are-bad.js
Created Aug 2, 2017 — forked from hallettj/global-variables-are-bad.js
How and why to avoid global variables in JavaScript
View global-variables-are-bad.js
// 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() {

Laravel - Eloquent - query many to many relationship


Table 1: posts

Table 2: categories

Pivot Table: category_post with foreign keys category_id, post_id

danielchikaka /
Created Jun 7, 2016 — forked from kbond/
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 "Your Name"
git config --global "Your Email"
danielchikaka / 01_Laravel 5 Simple ACL
Created Mar 8, 2016 — forked from amochohan/01_Laravel 5 Simple ACL
Laravel 5 Simple ACL - Protect routes by an account / role type
View 01_Laravel 5 Simple ACL

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.


Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

View Javascript Money format
function toCurrency(price) {
return price.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
danielchikaka / angular-remove-white-space-filter.js
Last active Aug 29, 2015 — forked from builtbylane/angular-remove-white-space-filter.js
AngularJS – filter: removes white space from text. useful for html values that cannot have spaces
View angular-remove-white-space-filter.js
* Description:
* removes white space from text. useful for html values that cannot have spaces
* Usage:
* {{some_text | nospace}}
app.filter('nospace', function () {
return function (value) {
return (!value) ? '' : value.replace(/ /g, '');
View function.js
Function.prototype.compose = function(argFunction) {
var invokingFunction = this;
return function() {
return, argFunction.apply(this,arguments));
You can’t perform that action at this time.