Skip to content

Instantly share code, notes, and snippets.

View mbaljeetsingh's full-sized avatar
:octocat:
Born to express not impress

Baljeet Singh mbaljeetsingh

:octocat:
Born to express not impress
View GitHub Profile
@mbaljeetsingh
mbaljeetsingh / index.html
Last active March 22, 2016 16:17
Add selected class to active nav item AngularJS (ui-router)
<div class="container" ng-controller="HeaderController">
<h1>This is my demo ui-router app.</h1>
<div class="navbar">
<a class="navbar-brand" href="#">ui-router</a>
<ul class="nav navbar-nav">
<li class="active">
<a ng-class="getClass('/state1')" ui-sref="state1">State1</a>
</li>
<li>
<a ng-class="getClass('/state2')" ui-sref="state2">State2</a>
@mbaljeetsingh
mbaljeetsingh / script.js
Last active August 29, 2015 14:17
Add selected class to active list item link AngularJS
.config(function($stateProvider, $urlRouterProvider) {
//
// For any unmatched url, redirect to /state1
$urlRouterProvider.otherwise("/state1");
//
// Now set up the states
$stateProvider
.state('state1', {
url: "/state1",
templateUrl: "partials/state1.html"
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"useTabs": false,
"arrowParens": "always"
}
# Add new line at the end of the file
for file in chapters/*
do
if [ -s "$file" ] && [ "$(tail -c1 "$file"; echo x)" != $'\nx' ]; then
echo "" >>"$file"
fi
done
@mbaljeetsingh
mbaljeetsingh / index.html
Created July 21, 2022 04:26
Replicate Bootstrap Grid with CSS Flexbox
<div class="row">
<div class="col-2"></div>
<div class="col-7"></div>
<div class="col-3"></div>
</div>