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
| class E(BaseException): | |
| def __new__(cls, *args, **kwargs): | |
| return cls | |
| def a(): yield | |
| a().throw(E) |
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
| // Original https://github.com/mozilla/fireplace/blob/c50b5ca51643f13ae2e8b3a003d3aa0432358bf7/hearth/media/js/user.js#L41 | |
| // Retrieve MCC and MNC from mozMobileConnection (requires "privileged" app type and "mobileconnection" permission) | |
| // and translates them to carrier and region via mobilenetwork.js | |
| try { | |
| // When Fireplace is served as a privileged packaged app (and not | |
| // served via Yulelog) our JS will have direct access to this API. | |
| var conn = navigator.mozMobileConnection; | |
| if (conn) { |
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 win = Ti.UI.createWindow(); | |
| var webView = Ti.UI.createWebView({ | |
| url: 'http://www.youtube.com/embed/' + myVideoID + '?autoplay=1&autohide=1&cc_load_policy=0&color=white&controls=0&fs=0&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0', | |
| enableZoomControls: false, | |
| scalesPageToFit: false, | |
| scrollsToTop: false, | |
| showScrollbars: 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
| /* | |
| * Android API Guide | |
| * http://developer.android.com/guide/topics/ui/actionbar.html | |
| * Android Design Guide | |
| * http://developer.android.com/design/patterns/actionbar.html | |
| * Titanium Mobile will support someday | |
| * https://jira.appcelerator.org/browse/TIMOB-2371 | |
| */ | |
| var osName = Ti.Platform.osname, | |
| isAndroid = osName==='android', |
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 win = Ti.UI.currentWindow; | |
| Titanium.PageFlip = Ti.PageFlip = require('ti.pageflip'); | |
| var pdf = 'http://assets.appcelerator.com.s3.amazonaws.com/docs/Appcelerator-IDC-Q1-2011-Mobile-Developer-Report.pdf'; | |
| var fileName = pdf.split('/').pop(); | |
| var pdfFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, fileName); | |
| function downloadPDF() { | |
| var progressBar = Ti.UI.createProgressBar({ max: 1, min: 0, value: 0, visible: true }); | |
| win.add(progressBar); |
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
| Intent intent = new Intent(Intent.ACTION_VIEW, | |
| Uri.parse("http://maps.google.com/maps?f=d&saddr=53.447,-0.878&daddr=51.448,-0.972")); | |
| intent.setComponent(new ComponentName("com.google.android.apps.maps", | |
| "com.google.android.maps.MapsActivity")); | |
| startActivity(intent); |