Skip to content

Instantly share code, notes, and snippets.

View lucahammer's full-sized avatar
💭
Cleaning code.

Luca Hammer lucahammer

💭
Cleaning code.
View GitHub Profile
@lucahammer
lucahammer / dartiagram.dart
Created July 24, 2014 17:40
basic bar charts with dart
/*
My first experiment with dart. Draws a very basic bar chart.
Needs to be included in an html-file which has a '<canvas id="dartiagram" width="500" height="300" class="center"></canvas>'.
German blogpost about the process: http://www.2-blog.net/2014/07/24/dartiagram-meine-erste-dart-library
*/
import 'dart:html';
var bars_data = [35, 20, 28, 20, 11, 45, 4, 12]; //Datenpunkte; TODO: dynamisch aus HTML holen
int gram_height = 500; //Höhe des Diagramms
int gram_width = gram_height; //Breite des Diagrams
@lucahammer
lucahammer / fbjson.dart
Last active June 22, 2018 14:46
get json, convert into map and output as html list German blogpost: http://www.2-blog.net/2014/08/14/summer-of-dart-json-via-http-abrufen-und-in-html-ausgeben
import 'dart:html';
import 'dart:async';
import 'dart:convert';
var host = "graph.facebook.com/v1.0"; //Facebook Graph API
var group = "229552893839458"; //Gruppe mit der ich aktuell arbeite
var url = "http://$host/$group"; //URL die Gruppeninfo als JSON zurückgibt
var data; //HTML Element, wo die Daten dargestellt werden
void main() {
import 'dart:html';
import 'dart:async';
import 'dart:convert';
var host = "graph.facebook.com/v1.0"; //Facebook Graph API
var group = "229552893839458"; //Gruppe mit der ich aktuell arbeite
var url = "http://$host/$group"; //URL die Gruppeninfo als JSON zurückgibt
var data; //HTML Element, wo die Daten dargestellt werden
var log; //HTML Element für Log-Einträge
var accessTokenShort = 'USE-YOUR-OWN'; //Access Token with group permissions (testing only!)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" conten=thtml"width=device-width, initial-scale=1">
<title>LummityFacebookGroups</title>
<script async type="application/dart" src="getfbgroupposts.dart"></script>
<script async src="packages/browser/dart.js"></script>
### Keybase proof
I hereby claim:
* I am lucahammer on github.
* I am lucahammer (https://keybase.io/lucahammer) on keybase.
* I have a public key whose fingerprint is D816 A992 7D19 46F1 7A99 C138 2D42 C075 A50A 1ACA
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am lucahammer on github.
  • I am lucahammer (https://keybase.io/lucahammer) on keybase.
  • I have a public key whose fingerprint is CC19 D72F 6628 B846 43EF A424 1604 4622 9092 CB8E

To claim this, I am signing this object:

'''
Create edges from a ordered list.
input:
attr1;id1
attr1;id2
attr1;id3
attr2;id1
attr2;id2
0;0
output (new file):
@lucahammer
lucahammer / twecoll
Last active December 12, 2021 08:42
Modified version of twecoll to generate GDF files for use with Gephi. Use "python twecoll.py edgelist -g -m USERNAME"
#!/usr/bin/env python
'''
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@lucahammer
lucahammer / json-to-gdf.py
Last active November 6, 2017 07:24
Converts a .json file generated by the lost circles extension to GDF. Searches the directory it is in for .json files. Start with "py json-to-gdf.py". Webversion: https://tools.lucahammer.at/jsongdf/
#!python3
'''
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
#!python3
'''
Use with comment file of facebook page.
todo: add time component
todo: fix import errors
todo: remove first line of csv