Skip to content

Instantly share code, notes, and snippets.

View jimmykane's full-sized avatar
🏠
Working from home

Dimitrios Kanellopoulos jimmykane

🏠
Working from home
View GitHub Profile
@davestern
davestern / hosts
Last active October 30, 2018 08:04
Ansible: how to set hostname before DNS assigned
ec2-1-2-3-4.compute-1.amazonaws.com new_hostname=new-hostname.example.com
ec2-5-6-7-8.compute-1.amazonaws.com
@jdiaz5513
jdiaz5513 / ascii_arty.py
Last active December 30, 2023 02:32
Console ASCII Art Generator
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_conversions import convert_color
from colormath.color_objects import LabColor
from colormath.color_objects import sRGBColor as RGBColor
@lukehorvat
lukehorvat / es6-map-to-object-literal.js
Last active January 8, 2024 10:32
Convert ES6 Map to Object Literal
let map = new Map();
map.set("a", 1);
map.set("b", 2);
map.set("c", 3);
let obj = Array.from(map).reduce((obj, [key, value]) => (
Object.assign(obj, { [key]: value }) // Be careful! Maps can have non-String keys; object literals can't.
), {});
console.log(obj); // => { a: 1, b: 2, c: 3 }
@hleinone
hleinone / normalize-gpx.js
Created April 25, 2017 06:44
Normalizes GPX file by replacing track points with exactly same coordinate with interpolated values, removing leaps with inhuman speed.
var fs = require("fs");
var xml2js = require("xml2js");
var gpx = process.argv[2];
// https://gist.github.com/wteuber/6241786
Math.fmod = function(a, b) {
return Number((a - (Math.floor(a / b) * b)).toPrecision(8));
};
@stephenjfox
stephenjfox / LedgerActivities.kt
Last active September 23, 2023 19:37
Parse XML in Kotlin with Jackson
import com.fasterxml.jackson.annotation.JsonAlias
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonRootName
import java.util.*
data class LedgerActivityDetail(
@set:JsonProperty("TransactionType")
var loanType: String? = null,
@raphaelvallat
raphaelvallat / ecg_derived_respiration.ipynb
Last active April 8, 2025 22:14
Extract respiration signal and respiratory rate from ECG using R-R interval.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.