Skip to content

Instantly share code, notes, and snippets.

View fahdi's full-sized avatar

Fahad Murtaza fahdi

View GitHub Profile
@fahdi
fahdi / index.html
Created September 30, 2016 21:53 — forked from anonymous/index.html
JS Bin // source http://jsbin.com/fadawif
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script>
@fahdi
fahdi / index.html
Created September 29, 2016 15:12 — forked from anonymous/index.html
Welcome to JS Bin // source http://jsbin.com/hidehuk
<script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>
<script src="https://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<script src="http://jashkenas.github.com/coffee-script/extras/coffee-script.js"></script>
<meta charset=utf-8 />
<title>Welcome to JS Bin</title>
<meta name="viewport" content="width=device-width">
<link href='http://fonts.googleapis.com/css?family=Doppio+One' rel='stylesheet' type='text/css'>
@fahdi
fahdi / eq_vs_at_vs_amp.html
Created September 26, 2016 07:24 — forked from RobertAKARobin/eq_vs_at_vs_amp.html
Angular Directives: `=` vs `@` vs `&`
<!DOCTYPE html>
<html>
<head>
<title>Angular</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
</head>
<body ng-app="myApp">
<div ng-controller="myCtrl as VM">
<a my-dir
attr1="VM.sayHi('Juan')"

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
<?php
add_action('nav_menu_css_class', 'add_current_nav_class', 10, 2 );
function add_current_nav_class($classes, $item) {
// Getting the current post details
global $post;
// Getting the post type of the current post
@fahdi
fahdi / code.php
Created December 31, 2013 04:44 — forked from anonymous/code.php
<?php
add_action( 'user_profile_update_errors', 'validate_field' );
function validate_field(&$errors, $update = null, &$user = null)
{
if($user->has_cap('s2member_level2')) { // Custom fields only display to business accounts
// Nested if to check for field(s)
if ($_POST['exp_years']=='' or $_POST['exp_years']==NULL) // Change to check for empty or any regular expression.
@fahdi
fahdi / home.php
Created November 30, 2013 22:29 — forked from slambert/home.php
<?php get_header() ?>
<!-- generated with home.php -->
<div id="home-banner">
<?php putRevSlider("tsleadin") ?>
</div><!-- #home-banner-->
<div id="home-container">
<!-- 1. Take your Campaign Monitor subscribe form as generated from within your account: -->
<form action="http://myaccount.createsend.com/t/r/s/aljhk/" method="post" id="subForm">
<div>
<label for="name">Name:</label><br /><input type="text" name="cm-name" id="name" /><br />
<label for="aljhk-aljhk">Email:</label><br /><input type="text" name="cm-aljhk-aljhk" id="aljhk-aljhk" /><br />
<input type="submit" value="Subscribe" />
</div>
</form>