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
| .google-maps-responsive { | |
| position: relative; | |
| padding-bottom: 75%; // This is the aspect ratio | |
| height: 0; | |
| overflow: hidden; | |
| } | |
| .google-maps-responsive iframe { | |
| position: absolute; | |
| top: 0; |
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
| [ | |
| { | |
| "name": "SERES VIVOS", | |
| "id": "192", | |
| "photo": "http://www.antcontroldeplagas.es/wp-content/uploads/2013/02/hormigas-head.jpg", | |
| "d": "Las hormigas son bonitas", | |
| "children": [ | |
| { | |
| "name": "ANIMALES", | |
| "id": "193", |
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
| #For example, you can run Python’s built-in server: | |
| python -m SimpleHTTPServer 8888 & |
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
| >>> Status = namedtuple('Status', 'open pending closed')._make(range(3)) | |
| >>> Status.open, Status.pending, Status.closed | |
| (0, 1, 2) | |
| >>> class Status: | |
| open, pending, closed = range(3) | |
| >>> Status.open, Status.pending, Status.closed | |
| (0, 1, 2) |
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
| # List of selected categories | |
| selected_categories = [Category.objects.get(name="TERRESTRE"), Category.objects.get(name="MOLUSCOS")] | |
| # Products we want to filter based on the list of selected categories | |
| products = Product.objects.filter(category__in = selected_categories) | |
| # list is a tuple of tuples like ((id1, product_count1), (id2, product_count2), ... , (idn, product_countn)) | |
| qs_count = Category.objects.values(‘id’).filter(product__in=products).annotate(Count('product')) | |
| # Get the values |
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
| Global setup: | |
| Set up git | |
| git config --global user.name "Orestes Sanchez" | |
| git config --global user.email orestes@acm.org | |
| Next steps: | |
| mkdir Drupal7-for-Arxiu-Hist-ric-del-Poblenou | |
| cd Drupal7-for-Arxiu-Hist-ric-del-Poblenou | |
| git init | |
| touch README |
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 ellipsisId= 'ellipsis_test_element'; | |
| var ellipsisElement= null; | |
| function insertEllipsisElement(){ | |
| if( !ellipsisElement){ | |
| ellipsisElement= document.createElement( 'div'); | |
| ellipsisElement.id= ellipsisId; | |
| document.body.appendChild( ellipsisElement); | |
| } | |
| } | |
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
| wget --spider -r -l0 -np -k http://www.yoursite.com/ |
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
| data= '[ "mykey": "myValue" ]' | |
| map = Eval.me( data ) | |
| // map= {myKey=myValue} |
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 MyClass{ | |
| def myname | |
| } | |
| class TestCase{ | |
| TestCase(){ } | |
| def testNonEmptyTask(){ | |
| def f = new MyClass() |