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
| import re | |
| from django.conf import settings | |
| from django.core import cache as django_cache | |
| from mock import patch | |
| from rest_framework.permissions import SAFE_METHODS | |
| from rest_framework.response import Response | |
| class CachedResourceMixin (object): | |
| @property |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| const SmoothRenderer = L.SVG.extend({ | |
| // Override the default _onZoom function, which simply scales the lower | |
| // resolution shapes. Instead, we want to reproject the shapes at each new | |
| // zoom level, as is done by default when zooming ends. | |
| _onZoom: function () { | |
| this._onZoomEnd(); | |
| this._update(); | |
| } | |
| }); |
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
| # Open django shell and do following. | |
| from django.urls import get_resolver | |
| def show_urls(urllist, depth=0): | |
| for entry in urllist: | |
| print(' ' * depth, entry.pattern) | |
| if hasattr(entry, 'url_patterns'): | |
| show_urls(entry.url_patterns, depth + 1) |
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
| mjumbewu@mjumbewu-xps ~ | |
| $ uname -a | |
| Linux mjumbewu-xps 3.5.0-22-generic #34+kamal11~DellXPS-Ubuntu SMP Fri Jan 11 09:12:57 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux | |
| mjumbewu@mjumbewu-xps ~ | |
| $ xinput list-props 12 | |
| Device 'CyPS/2 Cypress Trackpad': | |
| Device Enabled (132): 1 | |
| Coordinate Transformation Matrix (134): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 | |
| Device Accel Profile (255): 1 |
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> | |
| #checker-board { | |
| width: 400px; | |
| height: 400px; | |
| background-color: #ffbc00; | |
| border: 10px solid rgba(0,0,0,0.65); | |
| border-radius: 10px; | |
| position: relative; |
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 timeout(duration) { | |
| return new Promise((resolve) => { | |
| setTimeout(resolve, duration); | |
| }); | |
| } | |
| /* | |
| Example: | |
| async function dostuff() { |
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> | |
| html,body { | |
| padding: 0; | |
| margin: 0; | |
| } | |
| #left-paddle { | |
| background-color: green; |
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
| # ============================================================================= | |
| # ON THE SERVER... | |
| # Check the amount of disk space available on root (/) partition | |
| df -h | |
| # See where space is being consumed | |
| cd /; sudo du -h --max-depth=1 | |
| # In this case, most was in /emergence; further digging and du-ing |
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
| server { | |
| listen 80; | |
| return 301 https://\$host\$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; | |
| ssl_certificate [PATH_TO_SSL_CERT]; | |
| ssl_certificate_key [PATH_TO_SSL_CERT_KEY]; |
NewerOlder