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
@task | |
def install_elasticsearch(): | |
run( | |
'wget --no-check-certificate -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -') | |
run( | |
'echo "deb http://packages.elastic.co/elasticsearch/1.4/debian stable main" | sudo tee -a /etc/apt/sources.list') | |
run("sudo apt-get -qq update") | |
run("sudo apt-get -q upgrade -y") | |
run("sudo apt-get -q install -y openjdk-7-jre elasticsearch") | |
run("sudo update-rc.d elasticsearch defaults 95 10") |
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
from django.db import transaction | |
from django.test import TestCase | |
from users.models import User | |
from . import models | |
class MyTestCase(TestCase): | |
def test_create_expense(self): | |
user = User.objects.create(email="[email protected]") |
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
{% load staticfiles %} | |
<!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"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<title>Ex Man!!!!!</title> |
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 () { | |
"use strict"; | |
$("#update-btn").click(function () { | |
var el = $(this); | |
if (el.attr("disabled")) { | |
return; | |
} | |
var url = el.data("url"); | |
el.attr('disabled', "true"); |
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 os | |
# ...... | |
if os.name == 'nt': | |
OSGEO4W = r"C:\OSGeo4W" | |
os.environ['OSGEO4W_ROOT'] = OSGEO4W | |
os.environ['GDAL_DATA'] = OSGEO4W + r"\share\gdal" | |
os.environ['PROJ_LIB'] = OSGEO4W + r"\share\proj" | |
os.environ['PATH'] = OSGEO4W + r"\bin;" + os.environ['PATH'] |
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
<div id="add">Add!!</div> | |
<ul id="foo"> | |
<li>0</li> | |
<li>0</li> | |
<li>0</li> | |
<li>0</li> | |
<li>0</li> | |
<li>0</li> | |
<li>0</li> |
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
<table id="mytable" border="1"> | |
<tr> | |
<td>1</td> | |
<td>1</td> | |
<td>1</td> | |
<td>1</td> | |
</tr> | |
<tr> | |
<td>1</td> | |
<td>1</td> |
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
"use strict"; | |
$(function () { | |
$.get("/the/url/of/the/maps/", function (maps) { | |
$.each(function (i, map) { | |
console.log(map); | |
}) | |
}); |
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
def calc(s): | |
return 4 |
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
LEAFLET_CONFIG = { | |
'SPATIAL_EXTENT': (30, 29, 36, 33.5), | |
# 'DEFAULT_CENTER': MAP_CENTER, | |
'DEFAULT_ZOOM': 8, | |
'TILES': [ | |
('OVI Satellite', | |
'http://maptile.maps.svc.ovi.com/maptiler/maptile/newest/satellite.day/{z}/{x}/{y}/256/png8', | |
'OVI maps'), |