It is always recommened to use virtualenv while you are doing development. virtualenv lets you create isolated development environments. It will help you not to mixup dependencies when working on more than one project on your machine.
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
| /** | |
| * Inspired by ebidel@ (https://gist.github.com/ebidel/1b418134837a7dde7d76ed36288c1d16) | |
| * @author surma@ | |
| * License Apache-2.0 | |
| */ | |
| function* collectAllElementsDeep(selector = '*', root = document.all) { | |
| for (const el of root) { | |
| if (!el.matches(selector)) | |
| continue; |
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
| // usage: | |
| // importScript('./path/to/script.js').then((allExports) => { .... })); | |
| function importScript(path) { | |
| let entry = window.importScript.__db[path]; | |
| if (entry === undefined) { | |
| const escape = path.replace(`'`, `\\'`); | |
| const script = Object.assign(document.createElement('script'), { | |
| type: 'module', | |
| textContent: `import * as x from '${escape}'; importScript.__db['${escape}'].resolve(x);`, | |
| }); |
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
| # 1. Install brew --> http://brew.sh/ | |
| # 2. run the following commands in your Terminal | |
| brew tap homebrew/dupes | |
| brew tap homebrew/versions | |
| brew tap homebrew/homebrew-php | |
| brew install --with-openssl curl | |
| brew install --with-homebrew-curl --with-apache php71 | |
| brew install php71-mcrypt php71-imagick | |
| # 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot. | |
| brew info php71 |
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
| #!/bin/bash | |
| echo "Attempting to install debsums package" | |
| apt-get install --reinstall -y debsums | |
| echo "." | |
| echo "." | |
| echo "." | |
| echo "Running debsums to look for bad files. This will take a while." | |
| debsums -cs 2>&1 >badfiles.txt | |
| echo "." | |
| echo "." |
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
| """ | |
| An example of minimum requirements to make MultiValueField-MultiWidget for Django forms. | |
| """ | |
| import pickle | |
| from django.http import HttpResponse | |
| from django import forms | |
| from django.template import Context, Template | |
| from django.views.decorators.csrf import csrf_exempt |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
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
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |
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
| application: you-app-name-here | |
| version: 1 | |
| runtime: python | |
| api_version: 1 | |
| default_expiration: "30d" | |
| handlers: | |
| - url: /(.*\.(appcache|manifest)) | |
| mime_type: text/cache-manifest |