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
@raphaelvallat
raphaelvallat / ecg_derived_respiration.ipynb
Last active December 5, 2023 13:45
Extract respiration signal and respiratory rate from ECG using R-R interval.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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,
@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));
};
@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 }
@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
@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
@aaronwaldon
aaronwaldon / 1) readme.md
Last active May 13, 2021 09:26
How to set up Gulp for Compass compilation and minification, JavaScript minification, livereloading, and use with ExpressionEngine.

How to set up Gulp with an ExpressionEngine project

I freaking love working with technologies like Grunt and Gulp, and wanted to share how to get my current EE front-end workflow set up. With a few tweaks, this can also be used with virtually any other sites (I've used it with Laravel, static sites, Craft, etc).

Install Node.js

  • If Node is not yet installed on the machine, it will need to be installed

Install Gulp (if needed)

@bennadel
bennadel / angularjs-errors.htm
Created October 3, 2013 13:56
Logging Client-Side Errors With AngularJS And Stacktrace.js
<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>
Logging Client-Side Errors With AngularJS And Stacktrace.js
</title>
<style type="text/css">
@jegtnes
jegtnes / sass_colorfunctions.php
Created June 6, 2013 08:43
A function attempting to rudimentary replicate SASS lighten/darken functions. Adapted from Frxstrem's answer on StackOverflow: http://stackoverflow.com/questions/3512311/how-to-generate-lighter-darker-color-with-php
<?php
function sass_darken($hex, $percent) {
preg_match('/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i', $hex, $primary_colors);
str_replace('%', '', $percent);
$color = "#";
for($i = 1; $i <= 3; $i++) {
$primary_colors[$i] = hexdec($primary_colors[$i]);
$primary_colors[$i] = round($primary_colors[$i] * (100-($percent*2))/100);
$color .= str_pad(dechex($primary_colors[$i]), 2, '0', STR_PAD_LEFT);
}
@jkrems
jkrems / Vagrantfile
Created July 27, 2012 08:03
Simple vagrant setup with debian and puppet
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Map NFS uid/gid to current user. This can be used to create a
# user inside the VM with matching uid/gid which makes file access
# a lot easier.
config.nfs.map_uid = Process.uid
config.nfs.map_gid = Process.gid