Skip to content

Instantly share code, notes, and snippets.

@j127
j127 / user.js
Created October 27, 2016 04:21
Firefox preferences with user.js
// Don't connect to remote links on hover
user_pref("network.http.speculative-parallel-limit", 0);
// Don't trim URLs. This makes users ignorant of how URLs work
user_pref("browser.urlbar.trimURLs", false);
// Enable privacy protection
user_pref("privacy.trackingprotection.enabled", true);
// Don't autofill URL bar. It's faster to have the exact same behavior every time.
@j127
j127 / virtualenv-ubuntu.md
Last active January 15, 2016 19:21
Virtualenv and Virtualenvwrapper on Ubuntu (or similar)

How to install virtualenvwrapper on Ubuntu

Run these commands in the terminal. The $ means your terminal prompt.

$ sudo apt-get update
$ sudo apt-get install python-pip
$ sudo pip install virtualenv
$ sudo pip install virtualenvwrapper

Open up your .bashrc file. Example: gedit ~/.bashrc. If you use zsh, then edit ~/.zshrc instead. Put these lines at the bottom:

@j127
j127 / test.py
Created November 4, 2015 07:56
test
def x(y):
return y
@j127
j127 / fix-ie.html
Created September 26, 2015 03:59
Fix IE
<!--[if lt IE 10]>
<p class="browser-upgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://www.firefox.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
@j127
j127 / Mathjax
Created June 29, 2015 02:22
Difference between "inline" Mathjax and "block-level" Mathjax.
For equations on the same line, surround the equation with backslash-escaped parentheses like this: \( i^i \)
To put an equation on its own line, use backslash-escaped square brackets like this:
\[ i^i \]
or double dollar signs:
$$ i^i $$
@j127
j127 / index.html
Last active August 29, 2015 14:22
Quick HTML starter template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<!--<link href="//cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.4/paper/bootstrap.min.css" rel="stylesheet">-->
@j127
j127 / Sample Bootstrap (Bootswatch) Template
Last active August 29, 2015 14:21
Sample Bootstrap (Bootswatch) Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sample App</title>
<link href="//cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.4/cyborg/bootstrap.min.css" rel="stylesheet">
@j127
j127 / snippet.html
Last active August 29, 2015 14:04
Add "Sponsor" to a page
<!-- place the following line where you want the sponsor message to appear -->
<span class="s-message"></span>
<!-- place the following right before the </body> tag in the footer -->
<script>
$(document).ready(function () {
var message = "Sponsor",
target = $(".s-message");
// Check if there is that class on the page
@j127
j127 / Forum Error
Created June 6, 2014 18:58
Error page is noindexed with a meta tag.
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-ca">
<head>
<title>Something has gone wrong.</title>
<meta name="robots" content="noindex" />
<link rel="stylesheet" type="text/css" href="/applications/dashboard/design/error.css" /></head>
<body>
<div id="Content">
<div class="SplashInfo">
<h1>Something has gone wrong.</h1>