Skip to content

Instantly share code, notes, and snippets.

View yholkamp's full-sized avatar

Yorick Holkamp yholkamp

View GitHub Profile
@yholkamp
yholkamp / frank-onbalansmarkt.js
Last active August 3, 2025 13:25 — forked from erdebee/frank-onbalansmarkt.js
Post daily frank energie trading results to onbalansmarkt
/**
* JavaScript code om de opbrengst van een batterij naar Onbalansmarkt.com te sturen.
*
* Auteur: erdebee, met wijzigingen van verschillende gebruikers
* Update 2025-01-24: update om impex, Frank Slim korting en totaal handelsresultaat in te sturen.
* Update 2025-01-23: update naar netto 'totaal kortingsfactuur' ipv bruto resultaat
* Update 2025-02-10: hhi, gecombineerd resultaat voor de bijdragende individuele (Sessy) battterijen, met import/export kWhs en batterij-capaciteit
* Update 2025-07-01: hhi, toegevoegd de mogelijkheid om de batterij resultaten te vermenigvuldigen met het aantal deelnemende batterijen
* Update 2025-07-03: hhi, automatische bepaling van de handelsmodus en handelsstrategie van de batterij, en deze doorgeven aan Onbalansmarkt.com
*/
@yholkamp
yholkamp / how-to-restore.md
Created December 11, 2021 12:24 — forked from AmazingTurtle/how-to-restore.md
restore access to unifi controller

Restore access to a unifi controller

When you are unable to login to the unifi controller or forgot admin password, you can restore access using SSH and manipulating mongodb directly.

Warning

Do not uninstall unifi controller - most of the data is not stored in mongodb. In case you thought a mongodb backup would be sufficient, you may have fucked up already, just like me. However I managed to write this "tutorial" for anyone to not run into the same trap.

Steps

@yholkamp
yholkamp / Gemfile
Created October 16, 2015 12:28 — forked from mm53bar/Gemfile
Be sure to install the datadog agent on your server before applying this code to your app. Instructions are at https://app.datadoghq.com/account/settings#agent or use my Sunzi recipe at https://github.com/Shift81/sunzi-recipes/blob/master/ubuntu/precise/datadog.sh
gem 'dogstatsd-ruby'
<!--[if lte IE 6]>
<style type="text/css">
#ie6msg{border:3px solid #090; margin:8px 0; background:#cfc; color:#000;}
#ie6msg h4{margin:8px; padding:0;}
#ie6msg p{margin:8px; padding:0;}
#ie6msg p a.getie8{font-weight:bold; color:#006;}
#ie6msg p a.ie6expl{font-weight:normal; color:#006;}
</style>
<div id="ie6msg">
<h4>Did you know that your browser is out of date?</h4>
namespace :spec do
# largely lifted from http://www.pervasivecode.com/blog/2007/06/28/hacking-rakestats-to-get-gross-loc/
task :stats_setup do
require 'code_statistics'
class CodeStatistics
alias calculate_statistics_orig calculate_statistics
def calculate_statistics
@pairs.inject({}) do |stats, pair|
if 3 == pair.size