Skip to content

Instantly share code, notes, and snippets.

View AG4GitHub's full-sized avatar

Andreas Gehrmann AG4GitHub

View GitHub Profile
@Enrix835
Enrix835 / enrixpad
Created May 21, 2009 17:45
a simple text editor written in python
#enrixpad is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
@jasonrhodes
jasonrhodes / getProperty.js
Created April 6, 2012 17:40
Get a nested object property by passing a dot notation string as the property name
/**
* A function to take a string written in dot notation style, and use it to
* find a nested object property inside of an object.
*
* Useful in a plugin or module that accepts a JSON array of objects, but
* you want to let the user specify where to find various bits of data
* inside of each custom object instead of forcing a standardized
* property list.
*
* @param String nested A dot notation style parameter reference (ie "urls.small")
@pprett
pprett / boston.json
Created October 1, 2012 18:28
Decision Tree Viewer (D3 and Sklearn)
{"error": 42716.2954, "samples": 506, "value": [22.532806324110698], "label": "RM <= 6.94", "type": "split", "children": [{"error": 17317.3210, "samples": 430, "value": [19.93372093023257], "label": "LSTAT <= 14.40", "type": "split", "children": [{"error": 6632.2175, "samples": 255, "value": [23.349803921568636], "label": "DIS <= 1.38", "type": "split", "children": [{"error": 390.7280, "samples": 5, "value": [45.58], "label": "CRIM <= 10.59", "type": "split", "children": [{"error": 0.0000, "samples": 4, "value": [50.0], "label": "Leaf - 4", "type": "leaf"}, {"error": 0.0000, "samples": 1, "value": [27.9], "label": "Leaf - 5", "type": "leaf"}]}, {"error": 3721.1632, "samples": 250, "value": [22.90520000000001], "label": "RM <= 6.54", "type": "split", "children": [{"error": 1636.0675, "samples": 195, "value": [21.629743589743576], "label": "LSTAT <= 7.57", "type": "split", "children": [{"error": 129.6307, "samples": 43, "value": [23.969767441860473], "label": "TAX <= 222.50", "type": "split", "children": [{"err
@mfenniak
mfenniak / generate_dialogs.py
Created May 7, 2013 13:13
Script to convert a graphviz file (idempotent.dot) into an HTML + svg file with clickable nodes and edges that display data in a Bootstrap dialog. Used to generate https://mathieu.fenniak.net/idempotent-api-roadmap-prototype/, a prototype of a graph-based information delivery system. This script is a real ... efficient use of developer time. It …
import pydot
import subprocess
import sys
import re
print """<!DOCTYPE html>
<html>
<head>
<title>Idempotency Concept Roadmap Prototype</title>
<link href="https://mathieu.fenniak.net/wp-content/uploads/2013/05/bootstrap.min_.css" rel="stylesheet" media="screen">
@jasonkeene
jasonkeene / python_scripting.rst
Last active April 21, 2024 20:09
Get started with writing your own python scripts to automate system tasks.

Python for System Admins / Operators

Installing Python

Most Unix/Linux systems come with python pre-installed:

$ python -V
@terrywbrady
terrywbrady / GoogleSpreadsheet.html
Last active July 19, 2024 10:46
Sample HTML/JS to parse a Google Spreadsheet
<!doctype html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var spData = null;
function doData(json) {
spData = json.feed.entry;
}
@willpatera
willpatera / Google-Sheet-Form-Post.md
Last active May 3, 2024 12:57
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Depreciation Warning: This code is not maintained, and should be seen as reference implementation only. If you're looking to add features or update, fork the code and update as needed.

Run example

You should be able to just open index.html in your browser and test locally.

import graphviz as gv
g1 = gv.Graph(format='svg')
g1.node('A')
g1.node('B')
g1.edge('A', 'B')
print(g1.source)
@mwunsch
mwunsch / viz.js
Created April 23, 2015 14:31
DOM -> Graphviz
/*
This is an incredibly rudimentary PhantomJS script to walk a DOM and emit a graphviz `dot` document.
It is neither clever nor good.
Proceed with caution.
Usage: phantomjs viz.js http://2015.empirejs.org/ | tee >(dot -Tpng > test.png)
*/
var page = require('webpage').create();
var args = require('system').args;
@oshliaer
oshliaer / 70e04a67f1f5fd96a708.md
Last active August 5, 2023 09:22
Extract Gmail content to a spreadsheet #gas #gmail #sheet