Skip to content

Instantly share code, notes, and snippets.

View DecisionNerd's full-sized avatar

David Spencer DecisionNerd

View GitHub Profile
@korakot
korakot / neo4j.py
Last active May 11, 2024 01:27
Using Neo4j in Colab
# download 3.5.8 or neo4j-enterprise-4.0.0-alpha09mr02-unix
!curl https://neo4j.com/artifact.php?name=neo4j-community-3.5.8-unix.tar.gz -o neo4j.tar.gz
# decompress and rename
!tar -xf neo4j.tar.gz # or --strip-components=1
!mv neo4j-community-3.5.8 nj
# disable password, and start server
!sed -i '/#dbms.security.auth_enabled/s/^#//g' nj/conf/neo4j.conf
!nj/bin/neo4j start
/**
* Raspberry Pi - IP Camera
*
* Copyright 2015 st.john.johnson@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@gluc
gluc / Desc_JSON_to_df.md
Last active June 19, 2023 02:32
Convert a complex JSON to an R data.frame

This gist shows how to convert a nested JSON file to an R data.frame. To do this, it uses jsonlite and data.tree.

The gist contains two examples: one is a bit simpler, the second one a bit more advanced.

Example 1

In the first example, we download all the repos from Hadley Wickham's Github account from https://api.github.com/users/hadley/repos . This JSON contains a nested owner object. The code shows how to convert that in a flat data.frame in three statements:

  1. line 5: download
  2. line 8: convert to data.tree
@sanxfxteam
sanxfxteam / dataframeFromJSON
Last active November 14, 2017 05:04
R: flatten a JSON file into a data frame
## Example data.json
[{"event":"glop","params":{"name":"toto","value":"glop"}},
{"event":"glot","params":{"name":"toto","info":"gggg"}},
{"event":"gogo","params":"text"},
{"event":"gogo2"}
];
## Expected output
event params.name params.value params.info params
1 glop toto glop <NA> <NA>
@crofty
crofty / index.html
Last active October 22, 2021 08:24
A example of using Google Map tiles with the Leaflet mapping library - http://matchingnotes.com/using-google-map-tiles-with-leaflet
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script>
</head>
<body>
@fetep
fetep / 00-logstash.conf
Created December 31, 2011 06:54
Logstash JSON filter
input {
file {
type => syslog
path => "/var/log/messages"
}
}
filter {
grok {
type => syslog