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
Possible values for ext-name: | |
bcmath | |
bz2 | |
calendar | |
ctype | |
curl | |
dba | |
dom | |
enchant |
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
// Run this in the F12 javascript console in chrome | |
// if a redirect happens, the page will pause | |
// this helps because chrome's network tab's | |
// "preserve log" seems to technically preserve the log | |
// but you can't actually LOOK at it... | |
// also the "replay xhr" feature does not work after reload | |
// even if you "preserve log". | |
window.addEventListener("beforeunload", function() { debugger; }, false) |
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
## | |
# nginx server with http + ssl/https (no WP) | |
# /etc/nginx/sites-available/example.com | |
server { | |
listen 80; | |
server_name example.com; | |
location / { | |
proxy_pass http://no-ssl:8080; | |
proxy_set_header Host $host; |
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
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
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
if ($request_uri = /) { | |
set $test A; | |
} | |
if ($host ~* teambox.com) { | |
set $test "${test}B"; | |
} | |
if ($http_cookie !~* "auth_token") { | |
set $test "${test}C"; |
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 type='text/javascript'> | |
var link = !!document.querySelector("link[rel='canonical']") ? document.querySelector("link[rel='canonical']") : document.createElement('link'); | |
link.setAttribute('rel', 'canonical'); | |
link.setAttribute('href', location.protocol + '//' + location.host + location.pathname); | |
document.head.appendChild(link); | |
</script> |
Mercurial Commands
Commands | Description |
---|---|
hg pull | get latest changes like git pull use flags like -u IDK why yet |
hg add | only for new files |
hg commit | add changes to commit with -m for message just like git |
hg addremove | adds new files and removes file not in your file system |
hg incoming | see changes commited by others |
hg outgoing | see local commits |
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
function md5cycle(x, k) { | |
var a = x[0], b = x[1], c = x[2], d = x[3]; | |
a = ff(a, b, c, d, k[0], 7, -680876936); | |
d = ff(d, a, b, c, k[1], 12, -389564586); | |
c = ff(c, d, a, b, k[2], 17, 606105819); | |
b = ff(b, c, d, a, k[3], 22, -1044525330); | |
a = ff(a, b, c, d, k[4], 7, -176418897); | |
d = ff(d, a, b, c, k[5], 12, 1200080426); | |
c = ff(c, d, a, b, k[6], 17, -1473231341); |
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
try: | |
from django.utils.deprecation import MiddlewareMixin | |
except ImportError: | |
MiddlewareMixin = object | |
class ForceDefaultLanguageMiddleware(MiddlewareMixin): | |
""" | |
Ignore Accept-Language HTTP headers | |
NewerOlder