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
import os | |
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__) + '/../') | |
ENV_ROOT = os.path.abspath(PROJECT_ROOT + '/../') | |
ADMINS = ( | |
('XX', 'XXX@XXX.com'), | |
) | |
MANAGERS = ADMINS |
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
ROOT_DIR="$1" | |
mkdir "$ROOT_DIR" | |
cd "$ROOT_DIR" | |
#setup venv | |
virtualenv env --distribute | |
source env/bin/activate | |
#install django so we can start up an app |
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
<!-- templates/admin/custom_view.html --> | |
{% extends "admin/base_site.html" %} | |
{% load i18n %} | |
{% block breadcrumbs %} | |
<ul class="breadcrumb"> | |
<li class="active"> | |
<i class="icon-home"></i> | |
{% trans "Custom view" %} |
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 selector = 'img' // Replace this with the selector for the element you want to make transformable | |
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() { | |
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() { | |
(function() { | |
var $, applyTransform, getTransform, makeTransformable; | |
$ = jQuery; |
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
SYSTEM_MODE(MANUAL); | |
//Disables connection to Spark Cloud without additional API query | |
// UDP Port used for two way communication | |
unsigned int localPort = 8888; | |
const char *message = "A"; | |
unsigned int once = 0; | |
unsigned int ssdpport = 1900; | |
IPAddress ip( 239, 255, 255, 250 ); |
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
SYSTEM_MODE(MANUAL); | |
// UDP Port used for two way communication | |
unsigned int localPort = 1900; | |
unsigned int trigger = D0; | |
//Creates buffer variable and gives it a size | |
#define MAX_SIZE 1024 | |
char buffer[MAX_SIZE]; | |
//Creates UDP manipulation variable |
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
SYSTEM_MODE(MANUAL); | |
//Disables connection to Spark Cloud without additional API query | |
// UDP Port used for two way communication | |
unsigned int localPort = 8888; | |
const char *message = "A"; | |
unsigned int ssdpport = 1900; | |
IPAddress ip( 239, 255, 255, 250 ); |
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
<?php | |
function json_encode_pretty($obj, $indentation = 0) | |
{ | |
switch (gettype($obj)) | |
{ | |
case 'object': | |
$obj = get_object_vars($obj); | |
case 'array': | |
if (!isset($obj[0])) |
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
// Create index with mapping | |
curl -XPUT http://192.168.0.10:9200/geotest/ -d '{ | |
"settings" : { | |
"number_of_shards" : 1 | |
}, | |
"mappings" : { | |
"places" : { | |
"properties" : { | |
"name" : { "type" : "string" }, | |
"location" : { "type" : "geo_point", "lat_lon": true } |
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
// Index config | |
{ | |
"number_of_shards": 5, | |
"number_of_replicas": 1, | |
"analysis": { | |
"analyzer": { | |
"log_analyzer": { | |
"type": "custom", | |
"tokenizer": "pattern", | |
"filter": [ |
OlderNewer