Check if Karma is installed globally npm list -g –depth=0 The Master/Detail View paradigm is the most common real-world application for MV* frameworks The organization of your code should show intent and be self-documenting… node_modules src (project files / root … includes index.html and favicon.ico) app individual app JS files for controllers, templates, etc. main (main […]
JavaScript has syntax AND grammar Expressions and statements Statements are 1:1 and end with a semicolon (e.g. a = b * 2;) ‘2’ is a numerical expression ‘b’ is an identifier expression ‘b * 2’ is a mathematical expression ‘a = b * 2’ is a statement expression JavaScript uses operator precedence, but added unnecessary parenthesis […]
Commands & Notes git add <FILENAME> to add a single file or git add . to add all files to staging git commit -m “MESSAGE” to commit in one step without entering editor mode Git history commands: git log git log –pretty=oneline git log –pretty=oneline –max-count=2 git log –pretty=oneline –since=’5 minutes ago’ git log –pretty=oneline […]
Change Default Listening Port Go to MAMP > Preferences > Ports and set Apache Port to be 80. Set up Localhosts in Hosts File Edit your hosts file so that you have some domains that will resolve to your local web server… sudo pico /etc/hosts Add the domains you want to resolve to your localhost… 127.0.0.1 […]
A powerful API to store and sync data in realtime. Steps Install <script src=’https://cdn.firebase.com/js/client/2.2.1/firebase.js’></script> Reference (URL for your Firebase data) var myDataRef = new Firebase(‘https://xze3eg07ah9.firebaseio-demo.com/’); Write data with .set() method on a Firebase reference (write an object too) – myDataRef.set({name: name, text: text}); … In this example, when the object {name: name, text: text} is set, […]
pwd = Print Working Directory hostname = Display’s your computer’s network name mkdir DIRECTORY = Make directory cd = Change directory ls = List directory contents rmdir DIRECTORY = Remove directory pushd PATH = Saves current directory in memory, and takes you to the new path popd = Switches back to previous directory cp FILEPATH-FROM […]
Create new repo on GitHub Create folders and files locally and use Terminal to push repo up… git init git remote add origin git@github.com:USER/REPO.git git add . git commit git push origin
git checkout master /* switch to master branch */ git reset —hard /* clears local to match origin */ git branch -a /* lists branches */ git checkout BRANCH /* checks out BRANCH branch */
SharePoint has a nasty habit of fooling JavaScript into thinking the DOM is loaded when there are actually still elements popping in afterwards. Here’s a dirty script for testing the existence of a given element when you’re in a pinch… var wnt_spTimer, wnt_spElement; wnt_spTimer = window.setInterval(function(){ wnt_spElement = $(‘div[data-widget=”tools”] .heading-main h2’).length; if(wnt_spElement === 0){ console.log(‘******** […]
Google provides the ability to script spreadsheets via JavaScript and their library’s methods. Tools > Script editor… function DOUBLE(input) { return input * 2; // EXAMPLE … =DOUBLE(A2) }
<style> .myColumns { column-count: 2; -webkit-column-count: 2; -moz-column-count: 2; column-width: 250px; /* MINIMUM WIDTH */ -webkit-column-width: 250px; -moz-column-width: 250px; /* …or use COLUMNS shorthand… */ columns: 4 250px; -webkit-columns: 4 250px; -moz-columns: 4 250px; column-gap: 4em; /* Default is 1em */ -webkit-column-gap: 4em; -moz-column-gap: 4em; column-rule: 1px dotted #ddd; -webkit-column-rule: 1px dotted #ddd; -moz-column-rule: 1px […]
dp (Density Independent Pixels): is a measure of screen size dpi (Dots per Inch): is a measure of screen density iOS non-Retina to Retina display transition (163ppi to 326ppi) Size buckets are phone (smaller than 600dp) and tablet (larger than or equal 600dp) Density buckets for Android are LDPI, MDPI, HDPI, XHDPI, XXHDPI, and XXXHDPI ldpi: Resources for low-density […]
See the Pen Super Simple requestAnimationFrame Thing by Taylor Johnson (@webninjataylor) on CodePen.
You can create custom jQuery events with jQuery’s .on() method and then trigger your custom event with jQuery’s .trigger() method.
Event delegation is monitoring events on descendants via a common parent. This reduces overhead and allows for descendants not yet created to inherit the functionality. In addition, the term Event Bubbling is when an event is fired on an element and it “bubbles” up the DOM to the nearest ancestor with a handler for that […]