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
| console.log('%cNairobi', 'background: #FFDE00; color: #555; font-weight: bolder; font-size: 50px; padding: 5px 40px; solid #FFDE00;');console.log('%cJS', 'background: #FFDE00; color: #555; font-weight: bolder; font-size: 200px; padding: 0px 25px; solid #FFDE00;') |
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
| // ==================== Gainers Directive ======================= | |
| appEngine.directive('agCharts', function($chartDefaults) { | |
| return { | |
| restrict: 'E', | |
| // <ag-charts chart-id="[[co_gain.id ]]" options="[[ co_gain.options ]]"></ag-charts> | |
| scope: { | |
| chartId: '@', | |
| chartType: '@', | |
| years: '@', | |
| months: '@' |
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
| <!doctype html> | |
| <html class="no-js" lang=""> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="x-ua-compatible" content="ie=edge"> | |
| <title></title> | |
| <meta name="description" content=""> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
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
| <html> | |
| <head> | |
| <script language="javascript"> | |
| function ArrayList() { | |
| this.aList = []; //initialize with an empty array | |
| } | |
| ArrayList.prototype.Count = function() { | |
| return this.aList.length; |
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
| function extend(target_object) { | |
| // Look for additional parameters in this function | |
| // eg. extend(target_object, ....a,b,c,d) | |
| if (!arguments[1]) { | |
| return; | |
| } | |
| // If any extra arguments, which are objects | |
| // loop through them | |
| for (var index = 1; index < arguments.length; index++) { |
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
| var xhr = new XMLHttpRequest(); | |
| xhr.onreadystatechange = isReady(function(xhr) { | |
| console.log(xhr.responseText); | |
| }); | |
| function isReady(callback) { | |
| if (xhr.readyState < 4) { | |
| return; | |
| } |
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
| // ==UserScript== | |
| // @name Use Markdown, sometimes, in your HTML. | |
| // @author Paul Irish <http://paulirish.com/> | |
| // @link http://git.io/data-markdown | |
| // @match * | |
| // ==/UserScript== | |
| // If you're not using this as a userscript just delete from this line up. It's cool, homey. |
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
| var data = { | |
| ids: [12, 18, 27, 35, 41, 53, 66, 68, 72, 85, 94, 103, 111, 120, 133] | |
| } | |
| var xhr = new XMLHttpRequest(); | |
| xhr.onreadystatechange = function(xhr) { | |
| if (xhr.readyState < 4 || xhr.status !== 200) { | |
| return; | |
| } |
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
| // Uber-basic templating.. good? bad? ugly? | |
| function interpolate( str, data ) { | |
| data = data || window; | |
| return !str | |
| ? '' | |
| : str.replace( /{([^}]*)}/g, function(a,b){ | |
| return data[ 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
| /* | |
| == Tim == | |
| A tiny JavaScript micro-templating script. | |
| http://gist.github.com/521352 | |
| You can use Tim to write simple templates that use JavaScript's | |
| familiar dot notation to replace template tags with JSON object | |
| properties. | |