Skip to content

Instantly share code, notes, and snippets.

View danieledler's full-sized avatar

Daniel Edler danieledler

View GitHub Profile
@danieledler
danieledler / index.html
Created December 21, 2023 22:29
Proximity Glow Cards
<div class="container">
<article>
<div class="glows"></div>
<span class="header">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
<path fill-rule="evenodd" d="M17.303 5.197A7.5 7.5 0 006.697 15.803a.75.75 0 01-1.061 1.061A9 9 0 1121 10.5a.75.75 0 01-1.5 0c0-1.92-.732-3.839-2.197-5.303zm-2.121 2.121a4.5 4.5 0 00-6.364 6.364.75.75 0 11-1.06 1.06A6 6 0 1118 10.5a.75.75 0 01-1.5 0c0-1.153-.44-2.303-1.318-3.182zm-3.634 1.314a.75.75 0 01.82.311l5.228 7.917a.75.75 0 01-.777 1.148l-2.097-.43 1.045 3.9a.75.75 0 01-1.45.388l-1.044-3.899-1.601 1.42a.75.75 0 01-1.247-.606l.569-9.47a.75.75 0 01.554-.68z" clip-rule="evenodd" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
<path fill-rule="evenodd" d="M17.303 5.197A7.5 7.5 0 006.697 15.803a.75.75 0 01-1.061 1.061A9 9 0 1121 10.5a.75.75 0 01-1.5 0c0-1.92-.732-3.839-2.197-5.303zm-2.121 2.121a4.5
@danieledler
danieledler / convert_network_string_ids_to_integer.py
Created June 5, 2020 21:15
Convert network with string node ids to integer ids with node names in the Pajek format
import pandas as pd
def convert_to_integer_pajek(input_file, output_file, columns=['from', 'to', 'weight']):
"""
Convert network in link list format with string node ids to Pajek format with integer node ids
Assumes first row is a header with names matching `columns`
"""
net = pd.read_csv(input_file, delimiter=' ').dropna()
nodes = set(net[columns[0]])
nodes.update(net[columns[1]])
@danieledler
danieledler / Infomap-Louvain-number-of-modules-comparison.ipynb
Last active July 4, 2018 14:14
Number of modules found with Infomap and Louvain community detection algorithms on fully connected network with different link weight thresholds
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danieledler
danieledler / cleanup.js
Last active August 29, 2015 14:20 — forked from mbostock/cleanup.js
var fs = require("fs");
var roundPrecision = 1e6;
fs.readFile("/dev/stdin", "utf-8", function(error, input) {
var collection = JSON.parse(input);
switch (collection.type) {
case "FeatureCollection": return cleanupFeatureCollection(collection);
case "GeometryCollection": return cleanupGeometryCollection(collection);
default: throw "unknown type: " + collection.type;
@danieledler
danieledler / Rothstein-religion-kritik.ipynb
Last active August 29, 2015 14:16
Kritik av Rothsteins slutsats om religion i DN mars 2015
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.