Skip to content

Instantly share code, notes, and snippets.

@koshdnb
koshdnb / gist:4e227cbc0f3cecee9457
Created September 9, 2015 17:42
ng-model-options 1.2
angular.module("modelOptions", []).directive("ngModelOptions", function () {
return {
priority: 1,
restrict: "A",
//require: "ngModel",
require: ['ngModel'/*, '^?select'*/],
link: function (scope, elm, attr, ctrls) {
function apply() {
@koshdnb
koshdnb / Greensock Draggable latest update.markdown
Created June 5, 2015 04:22
Greensock Draggable latest update

Greensock Draggable latest update

Simple example of the latest update of Greensock's Draggable tool.

See how it works in transformed objects. In this case only the parent is transformed but it can work with the child element being transformed too.

A Pen by Rodrigo Hernando on CodePen.

License.

@koshdnb
koshdnb / Sortable list with GSAP Draggable.markdown
Created June 4, 2015 15:00
Sortable list with GSAP Draggable
app.directive('infiniteScroll', [
'$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) {
return {
link: function(scope, elem, attrs) {
var checkWhenEnabled, handler, scrollDistance, scrollEnabled;
$window = angular.element($window);
elem.css('overflow-y', 'scroll');
elem.css('overflow-x', 'hidden');
elem.css('height', 'inherit');
scrollDistance = 0;
@koshdnb
koshdnb / mobiles-and-tablets-viewport-sizes
Created April 4, 2015 19:09 — forked from francoishill/gist:6483997
mobiles-and-tablets-viewport-sizes
/*http://i-skool.co.uk/mobile-development/web-design-for-mobiles-and-tablets-viewport-sizes/*/
/*At least requires the meta viewport tag with content 'width=device-width'*/
@media only screen and (max-width: 1080px) and (orientation : portrait) {
/* PORTRAIT:
Windows Surface Pro*/
}
@media only screen and (max-width: 800px) and (orientation : portrait) {
/* PORTRAIT:
Acer Iconia Tab A100
@koshdnb
koshdnb / Modular-Typography.markdown
Created September 6, 2014 23:48
A Pen by John W. Long.
@koshdnb
koshdnb / Material-Response.markdown
Created September 5, 2014 16:07
A Pen by Manar.
@koshdnb
koshdnb / 0_reuse_code.js
Created June 30, 2014 06:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console