Skip to content

Instantly share code, notes, and snippets.

View jj0hns0n's full-sized avatar

Jeffrey Johnson jj0hns0n

View GitHub Profile
{
"city": "Barranquilla",
"country": "Colombia",
"year": 2025,
"news_sources": [
{
"name": "El Heraldo",
"url": "https://www.elheraldo.co",
"language": "Spanish"
},
{
"city": "Manila",
"country": "Philippines",
"year": 2025,
"articles": [
{
"title": "Metro Manila Index Crimes Down by 19.6% in January 2025",
"date": "2025-02-02",
"source": {
"name": "Manila Bulletin",
{
"city": "Manila",
"country": "Philippines",
"year": 2025,
"news_sources": [
{
"name": "Manila Bulletin",
"url": "https://mb.com.ph/",
"language": "English"
},
{
"city": "São Paulo",
"country": "Brazil",
"year": 2025,
"key_news_sources": [
{
"name": "Folha de S.Paulo",
"url": "https://www.folha.uol.com.br"
},
{
WITH base_risk AS (
SELECT
*,
(
-- Base risk calculation using already inverted scores
(prosperity_score_inverted * 0.35) +
(safety_and_security_inverted * 0.25) +
(violent_crime_inverted * 0.20) +
(property_crime_inverted * 0.10) +
(personal_freedom_inverted * 0.10)
WITH base_risk AS (
SELECT
*,
(
(100 - prosperity_score) * 0.10 +
(100 - safety_and_security) * 0.10 +
(100 - violent_crime) * 0.30 +
(100 - property_crime) * 0.25
) AS base_risk_score
FROM your_table
{
"jobTypes" : [
{
"featureDefinitions" : [
{
"featureClass" : "Pole",
"geometryType" : "Point",
"featureIdAttribute" : "Number",
"arColor" : "#ffff00",
"fixedDistanceInformation" : {
@jj0hns0n
jj0hns0n / gist:47fb3e803693fba2761ba10fb60bb807
Last active August 23, 2016 09:37
GeoNode Developers Workshop
http://docs.geonode.org/en/master/tutorials/overview_and_ref/reference_doc/architecture.html
workon geonode_live
cd geonode_live
python manage.py updatelayers
python manage.py loaddata ../geonode/geonode/base/fixtures/initial_data.json
import xml.etree.ElementTree as ET
from xml.dom import minidom
namespaces = {
'sld': 'http://www.opengis.net/sld',
'ogc': 'http://www.opengis.net/ogc',
'gml':'http://www.opengis.net/gml'
}
for prefix, uri in namespaces.iteritems():
@jj0hns0n
jj0hns0n / gist:8043396
Last active December 31, 2015 20:58
GeoNode Jenkins Setup on ec2
ec2 m1.small using i-93c43aed
Elastic IP 54.197.230.116 assigned to instance ID i-93c43aed
build.geonode.org configured to use 54.197.230.116
old server is here 184.154.70.228 (all services other than ssh are disabled)
geonode-dev.pem key used
Ports 80 8000 8080 and 8088 opened in ec2 security group
# ssh into server
sudo updatedb
sudo apt-get update