##Angular directives for Flat UI
- checkboxes
- radio buttons
- switches
Check the JSFiddle
###Example
| google.maps.Map.prototype.setCenterWithOffset= function(latlng, offsetX, offsetY) { | |
| var map = this; | |
| var ov = new google.maps.OverlayView(); | |
| ov.onAdd = function() { | |
| var proj = this.getProjection(); | |
| var aPoint = proj.fromLatLngToContainerPixel(latlng); | |
| aPoint.x = aPoint.x+offsetX; | |
| aPoint.y = aPoint.y+offsetY; | |
| map.setCenter(proj.fromContainerPixelToLatLng(aPoint)); | |
| }; |
| app.directive('inputMaxlength', function() { | |
| return { | |
| require: 'ngModel', | |
| link: function (scope, element, attrs, ngModelCtrl) { | |
| var maxlength = Number(attrs.inputMaxlength); | |
| function fromUser(text) { | |
| if (text.length > maxlength) { | |
| var transformedInput = text.substring(0, maxlength); | |
| ngModelCtrl.$setViewValue(transformedInput); | |
| ngModelCtrl.$render(); |
| /** | |
| * Retrieves all the rows in the active spreadsheet that contain data and logs the | |
| * values for each row. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function readRows() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var rows = sheet.getDataRange(); | |
| var numRows = rows.getNumRows(); |
##Angular directives for Flat UI
Check the JSFiddle
###Example
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| # Python script to find the largest files in a git repository. | |
| # The general method is based on the script in this blog post: | |
| # http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
| # | |
| # The above script worked for me, but was very slow on my 11GB repository. This version has a bunch | |
| # of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects. | |
| # |
| import os | |
| import time | |
| # Config | |
| NAME = ["Steven Kafshaz"] | |
| LASTMSG = {} | |
| def filesbychannel(dirlist): | |
| out = {} |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| using UnityEngine; | |
| using System.Collections; | |
| public class CameraShake : MonoBehaviour | |
| { | |
| // Transform of the camera to shake. Grabs the gameObject's transform | |
| // if null. | |
| public Transform camTransform; | |
| // How long the object should shake for. |
| { | |
| "directory": "components" | |
| } |