This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| puts "<< De Morgan's laws >>\n\n" | |
| PAIRS = [ | |
| [false, true], | |
| [true, false], | |
| [true, true], | |
| [false, false] | |
| ] | |
| puts "\"NOT (A AND B)\" is the same as \"(NOT A) OR (NOT B)\"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // In app.js or main.js or whatever: | |
| // var myApp = angular.module('askchisne', ['ngSanitize', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']); | |
| // This filter makes the assumption that the input will be in decimal form (i.e. 17% is 0.17). | |
| myApp.filter('percentage', ['$filter', function ($filter) { | |
| return function (input, decimals) { | |
| return $filter('number')(input * 100, decimals) + '%'; | |
| }; | |
| }]); |