Skip to content

Instantly share code, notes, and snippets.

View hkilter's full-sized avatar
😐
Meh

H. Kemal İlter hkilter

😐
Meh
View GitHub Profile
@hkilter
hkilter / scom.xml
Created September 26, 2014 16:01
Output of PARSX - scom.xml
<?xml version="1.0" encoding="UTF-8"?>
<scom>
<layer>
<layer_id>36</layer_id>
<layer_name>abc</layer_name>
<layer_value>7.6</layer_value>
</layer>
<layer>
<layer_id>40</layer_id>
<layer_name>def</layer_name>
@hkilter
hkilter / scom.csv
Last active August 29, 2015 14:06
csv file for PARSX
layer name layer id sublayers
product 1 2
agent 2 0
flow 3 0
operations 4 5
@hkilter
hkilter / parsx.py
Last active August 29, 2015 14:06
PARSX (Supply chain parser for SCML)
# Name: parsx.py
# Type: Parser
# Purpose: PARSX: XSCML parser
import csv
csvFile = 'scom-example.sc' # SC input
xmlFile = 'scom-example.xml' # XML output
csvData = csv.reader(open(csvFile))
xmlData = open(xmlFile, 'w')
Today is a XML day for me. I am trying to parse a CSV file to a meaningful XML file to produce represent it on SCOM architecture. I wrote a Python code for parsing a basic SCOM CVS file to a fundamental SCOM XML file like that:
Python code:
import csv
csvFile = 'scom.csv'
xmlFile = 'scom.xml'
@hkilter
hkilter / py2svg.txt
Last active August 29, 2015 14:06
Converting a python list to an SVG path by Peter Collingridge
from: http://www.petercollingridge.co.uk/blog/converting-python-list-svg-path
Here's a short snippet of Python code that was I very pleased with. It converts a list of coordinates, such as this:
```
[(10, 200), (12, 220), (15, 180)]
```
Into the d attribute of an SVG path, such as this:
@hkilter
hkilter / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env ruby
#
# This script is a wrapper around pandoc that uses pandoc's
# builtin citeproc support to generate a markdown bibliography
# from bibtex.
#
# Inspired by Jacob Barney's [bib2mkd][] script.
#
# [bib2mkd]: http://jmbarney.dyndns.org/?/linux/bib2mkd/
#