# Turn off your Vagrant machine
$ vagrant halt
# Comment out this line in Vagrantfile
# config.disksize.size = '30GB'
This file contains 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
def _set_files(files): | |
if current.request.ajax: | |
current.response.js = (current.response.js or '') + """;(function ($) { | |
var srcs = $('script').map(function(){return $(this).attr('src');}), | |
hrefs = $('link').map(function(){return $(this).attr('href');}); | |
$.each(%s, function() { | |
if ((this.slice(-3) == '.js') && ($.inArray(this.toString(), srcs) == -1)) { | |
var el = document.createElement('script'); el.type = 'text/javascript'; el.src = this; | |
document.body.appendChild(el); | |
} else if ((this.slice(-4) == '.css') && ($.inArray(this.toString(), hrefs) == -1)) { |
This file contains 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
script = SCRIPT(""" | |
jQuery(function() { var t = 10; (function run() {if ((function() { | |
var el = jQuery("#%(id)s"); | |
if (el.AnyTime_picker == undefined) { return true; } | |
el.AnyTime_noPicker().AnyTime_picker( | |
jQuery.extend({format: "%%Y-%%m-%%d", labelTitle: "%(title)s"}, | |
%(date_option)s)); | |
})()) {setTimeout(run, t); t = 2*t;}})();}); | |
""" % dict(id=_id, title=current.T('Choose date'), | |
date_option=_get_date_option())) |
This file contains 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
def descendants_from_node(self, node, include_self=False): | |
db, table_node = self.db, self.settings.table_node | |
node = self._load_node(node) | |
left, right = node.left, node.right | |
if include_self: | |
left -= 1 | |
right += 1 | |
return db(table_node.left > left)(table_node.right < right)( |
This file contains 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
--- a/modules/plugin_lazy_options_widget.py | |
+++ b/modules/plugin_lazy_options_widget.py | |
@@ -37,6 +37,9 @@ class lazy_options_widget(SQLFORM.widgets.options): | |
self.keyword = self.keyword % dict(fieldname=field.name) | |
requires = field.requires | |
+ | |
+ if isinstance(requires, IS_EMPTY_OR): | |
+ requires = requires.other | |
if not isinstance(requires, (list, tuple)): |
This file contains 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
NSMutableArray *tasks = [[NSMutableArray alloc] init]; | |
[tasks addObject: ^() { | |
NSLog(@"task1"); | |
}]; | |
[tasks addObject: ^() { | |
NSLog(@"task2"); | |
}]; | |
for (void (^task)() in tasks) { | |
task(); | |
} |
This file contains 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
NSMutableArray *tasks = [[NSMutableArray alloc] init]; | |
void (^nextTask)() = ^() { | |
[tasks removeObjectAtIndex: 0]; | |
if ([tasks count] > 0) { | |
void (^task)() = [tasks objectAtIndex: 0]; | |
task(); | |
} | |
}; | |
[tasks addObject: ^() { | |
NSLog(@"task1"); |
This file contains 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
dispatch_queue_t trail_queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
dispatch_group_t trail_group = dispatch_group_create(); | |
NSMutableArray *tasks = [[NSMutableArray alloc] init]; | |
void (^nextTask)() = ^() { | |
[tasks removeObjectAtIndex: 0]; | |
if ([tasks count] > 0) { | |
void (^task)() = [tasks objectAtIndex: 0]; | |
task(); | |
} else { |
This file contains 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 SamplePage.xaml | |
////////////////////////////////////////////////////// | |
<local:Breadcrumbs Height="25" MaxWidth="475" | |
ItemsSource="{Binding Source={StaticResource sampleBreadcrumbsViewSource}}" | |
> | |
<local:Breadcrumbs.ItemTemplate> | |
<DataTemplate> | |
<Button VerticalAlignment="Top" Margin="0,0,5,0" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer