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
# -*- coding: utf-8 -*- | |
# Generated by Django 1.9.2 on 2016-03-11 23:37 | |
from __future__ import unicode_literals | |
from django.db import migrations, models | |
class Migration(migrations.Migration): | |
def foo(apps, schema_editor): |
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
// base.html | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
var csrf = "{% csrf_token %}"; | |
$.cookie("csrfmiddlewaretoken", csrf); | |
}); | |
</script> | |
// script.js | |
var csrf_func = function(){ |
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
# added this to | |
# ~/.ssh/config | |
Host ec2-52-38-4-225.us-west-2.compute.amazonaws.com | |
User ubuntu | |
IdentityFile ~/foobar.pem | |
IdentitiesOnly yes |
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
var keycode = event.which; | |
var valid_key = (keycode > 47 && keycode < 58) || | |
(keycode > 64 && keycode < 91) || | |
keycode == 8 || keycode == 48 || | |
keycode == 190; |
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
var http_request = new XMLHttpRequest(); | |
http_request.open("GET", "{% url 'api_categories' %}"); | |
http_request.send(null); | |
http_request.onreadystatechange = function(){ | |
var DONE = 4; | |
var OK = 200; | |
if (http_request.readyState === DONE){ | |
if (http_request.status === OK){ | |
console.log(http_request.responseText); | |
} else { |
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
document.addEventListener("DOMContentLoaded", function(){}); |
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
var foo_app = angular.module("foo_app", []); | |
foo_app.controller("bar_controller", ["$scope", "$http", | |
function ($scope, $http){ | |
$http({ | |
method: "GET", | |
url: "api/foo/bar/", | |
}).then( | |
function successCallback(response){ | |
console.log(response); |
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
<!doctype html> | |
<html ng-app> | |
<head> | |
<title>My Angular App</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
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
# collects and installs each requirement fully one at a time. | |
# rather than collecting all packages then installing. | |
import pip | |
from subprocess import call | |
with open("requirements.txt", "r") as req: | |
for package in req: | |
call("pip install " + package, shell=True) |
OlderNewer