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 Runner { | |
public readonly targetRequests: number; | |
private _requests = 0; | |
constructor(targetRequests: number) { | |
this.targetRequests = targetRequests; | |
} | |
public async run(): Promise<void> { |
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
from django.conf.urls.defaults import * | |
from shoppingcart import views | |
urlpatterns = patterns('shoppingcart.views', | |
url(r'^products/(?P<slug>[^\/]+)/$', | |
view=views.product, | |
name='shoppingcart-product'), | |
url(r'^\.php\?pid=(?P<slug>[0-9]+)$', | |
view=views.product, |
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
#sortable-delete { | |
height: 18px; | |
overflow: hidden; | |
background: url('/resources/img/bin.png') 0 50% no-repeat; | |
} | |
#sortable-delete li { | |
height: 0; | |
width: 0; | |
overflow: hidden; | |
} |
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
# Sort a list of dictionary objects by a key - case sensitive | |
from operator import itemgetter | |
mylist = sorted(mylist, key=itemgetter('name')) | |
# Sort a list of dictionary objects by a key - case insensitive | |
mylist = sorted(mylist, key=lambda k: k['name'].lower()) |