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 iterator_map_to_array(\Iterator $iterator, $callback, $use_keys = true){ | |
| foreach($iterator as $i){ | |
| $i = $callback($i); | |
| } | |
| return iterator_to_array($iterator, $use_keys); | |
| } | |
| return iterator_map($cursor, function($i){ | |
| return new MyObject($i); | |
| }, false); |
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
| // mongodb collection generator for getting random documents... | |
| // set to the collection you wish to add a random attribute to. | |
| var collection = 'myCollection', | |
| // the name of the random collection to be generated; what you'll run queries against | |
| // to obtain a random document | |
| randCollection = 'rand' + collection.charAt(0).toUppderCase(), | |
| // wheter or not the random collection should contain full documents, or a truncated | |
| // version of the document (the mongo $_id and random attribute only) | |
| useTruncatedDoc = false; |
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> | |
| <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> | |
| <title>layers</title> | |
| <style> |
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 (root, doc, factory) { | |
| if (typeof define === 'function' && define.amd) { | |
| define(['global/jquery'], function( $ ) { | |
| factory( $, root, doc); | |
| return $; | |
| }); | |
| } else { | |
| factory( root.jQuery, root, doc); |
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> | |
| <style> | |
| @-webkit-keyframes clockwise { | |
| from { | |
| -webkit-transform: rotate(0deg); | |
| } | |
| to { | |
| -webkit-transform: rotate(360deg); | |
| } |
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
| /** | |
| * Attempt for Chrome-style progress-indicator with SVG and CSS animations | |
| */ | |
| @keyframes spin { | |
| to { | |
| stroke-dashoffset: 360; | |
| } | |
| } |
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
| /** @jsx React.DOM */ | |
| define(['reactjs'], function(React){ | |
| return React.createClass({ | |
| getDefaultProps: function(){ | |
| return { | |
| multiple: false | |
| /* | |
| name: 'mySelect' |
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
| // Moves the BitBucket Activity Stream out of the ".sidebar" | |
| (function(){ | |
| var o = document.getElementById('dashboard-overview') || document.getElementById('repo-overview') || document.getElementById('profile-tab-content'); | |
| if (!o) return; | |
| a = o.querySelector('.sidebar'), | |
| m = o.firstElementChild; | |
| o.insertBefore(a, m); | |
| a.classList.remove('sidebar'); | |
| if (o.id === 'profile-tab-content') { |
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
| tell application "Safari" | |
| activate | |
| end tell | |
| try | |
| tell application "System Events" to tell process "Safari" | |
| click menu item 2 of menu of menu item "iOS Simulator" of menu 1 of menu bar item "Develop" of menu bar 1 | |
| end tell | |
| on error error_message | |
| return error_message |
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
| define([ | |
| /* global Backbone */ | |
| 'backbone' | |
| ], function(){ | |
| 'use strict'; | |
| /** | |
| * Override for Backbone.Collection.sort to allow for simple reversing using | |
| * a 'reverse' boolean option. |