Skip to content

Instantly share code, notes, and snippets.

View codef0rmer's full-sized avatar
🏠
Working from home

Amit Gharat codef0rmer

🏠
Working from home
View GitHub Profile
@codef0rmer
codef0rmer / pedigree.php
Created June 15, 2012 12:34
Rendering Pedigree/Family Tree using HTML table
$arrPedigree = array(
array(
'name' => 'Parent',
'children' => array(
array(
'name' => 'Child 1',
'children' => array(
array(
'name' => 'Sub Child 11',
'children' => array(
@codef0rmer
codef0rmer / pagenav_bootstrap.html
Created September 19, 2012 14:29
Page Navigation Bar in Twitter Bootstrap
<div class="well sidebar-nav" ng-app="navList">
<ul class="nav nav-list" ng-controller="navCtrl">
<li ng-class="navClass('home')"><a href='#/home'>Home</a></li>
<li ng-class="navClass('about')"><a href='#/about'>About Us</a></li>
<li ng-class="navClass('contact')"><a href='#/contact'>Contact Us</a></li>
</ul>
</div>
@codef0rmer
codef0rmer / pagenav_ngclass.js
Created September 19, 2012 15:23
Page Navigation Bar in Angular.js
var navList = angular.module('navList', []);
navList.controller('navCtrl', ['$scope', '$location', function ($scope, $location) {
$scope.navClass = function (page) {
var currentRoute = $location.path().substring(1) || 'home';
return page === currentRoute ? 'active' : '';
};
}]);
@codef0rmer
codef0rmer / share-data-angular.html
Created October 15, 2012 05:45
Sharing data between a controller and an application in AngularJS
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script>
<script>
var myApp = angular.module('myApp', []);
myApp.run(function($rootScope) {
$rootScope.btnVal = 'You can change my value';
});
@codef0rmer
codef0rmer / angular-jqueryui-dnd.html
Last active February 22, 2018 10:23
AngularJS + jQueryUI Drag & Drop
<!DOCTYPE html>
<html ng-app="App">
<head>
<meta name="description" content="AngularJS + jQuery UI Drag-n-Drop" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<meta charset=utf-8 />
@codef0rmer
codef0rmer / jquery-toolbar.html
Created February 26, 2019 17:50
jquery toolbar
<!-- Invoking the toolbar -->
<div id="toolbarBtn" class="btn-toolbar"><i class="fa fa-cog"></i></div>
<!-- Actual toolbar -->
<div id="toolbar" class="hidden">
<a href="#"><i class="fa fa-plane"></i></a>
<a href="#"><i class="fa fa-car"></i></a>
<a href="#"><i class="fa fa-bicycle"></i></a>
</div>
$('#toolbarBtn').toolbar({
content: '#toolbar',
position: 'top'
});
<!-- Actual toolbar -->
<div id="toolbar-boys-options" class="hidden">
<a href="#"><i class="fa fa-plane"></i></a>
<a href="#"><i class="fa fa-car"></i></a>
<a href="#"><i class="fa fa-bicycle"></i></a>
</div>
<!-- Invoking the toolbar -->
<div appToolbarBoys class="btn-toolbar"><i class="fa fa-cog"></i></div>
// boys.directive.ts
import { Directive, ElementRef } from '@angular/core';
declare const $: any;
@Directive({
selector: '[appToolbarBoys]'
})
export class BoysDirective {
constructor(private el: ElementRef) {
<app-toolbar-men>
<div id="toolbar-men-options" class="hidden">
<a href="#"><i class="fa fa-heart"></i></a>
<a href="#"><i class="fa fa-heart-o"></i></a>
<a href="#"><i class="fa fa-heartbeat"></i></a>
</div>
</app-toolbar-men>