What is Meteor.js?
- CLI tool (meteor)
- Library of packages
- Open source
- Built on Node.js
| // | |
| // Lambda's timeout needs to be >5 seconds, 10 should do | |
| // | |
| var startedAt = new Date(); | |
| var interval = setInterval(function () { | |
| console.log(startedAt, new Date()); | |
| }, 1000); |
| input.form-submit.button-small { | |
| padding: 4px 8px; | |
| font-weight: bold; | |
| } | |
| .container-inline input.form-submit.button-small + .ajax-progress.ajax-progress-throbber .throbber { | |
| position: absolute; | |
| left: 19px; | |
| margin-top: 7px; | |
| } |
| watchdog('module_name', 'Your Object: !object', array('!object' => '<pre>' . check_plain(print_r($object, TRUE)) . '</pre>'), WATCHDOG_ERROR); |
| { | |
| "variables": { | |
| "aws_access_key": "{{env `AWS_ACCESS_KEY`}}", | |
| "aws_secret_key": "{{env `AWS_SECRET_KEY`}}" | |
| }, | |
| "builders": [ | |
| { | |
| "type": "amazon-ebs", | |
| "ssh_pty": true, | |
| "access_key": "{{user `aws_access_key`}}", |
| .block | |
| -(1..6).each do |i| | |
| .element #{i} |
| var array = []; | |
| function closest(array,num){ | |
| var i=0; | |
| var minDiff=1000; | |
| var ans; | |
| for(i in array){ | |
| var m=Math.abs(num-array[i]); | |
| if(m<minDiff){ | |
| minDiff=m; |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| <?php | |
| /** | |
| * This snippet adds extra classes to Drupal | |
| * menu leafs (li tags) and menu itself (ul tags). | |
| */ | |
| /** | |
| * Since the standart preprocess function for menu tree, which is | |
| * template_preprocess_menu_tree, located in includes/menu.inc, |
| (function($) { | |
| /** | |
| * We have to get a collection of id's because the HTML5 player moves the DOM | |
| * around and returns different elements when caching the selectors. | |
| */ | |
| var elements = $('.video-player > div, .video-player object'), | |
| playerIds = []; | |
| elements.each(function(i, player) { | |
| playerIds.push(player.id); |