Skip to content

Instantly share code, notes, and snippets.

View knutfh's full-sized avatar

Knut Flage Henriksen knutfh

View GitHub Profile
@gordthompson
gordthompson / mssql_df_upsert.py
Last active October 19, 2023 09:37
Build a T-SQL MERGE statement and upsert a DataFrame
# Copyright 2023 Gordon D. Thompson, gord@gordthompson.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@ttscoff
ttscoff / barchart.rb
Last active January 2, 2022 10:40
Command line bar chart from JSON data (for GeekTool, et al)
#!/usr/bin/env ruby
# encoding: utf-8
# Brett Terpstra 2013, WTF license <http://www.wtfpl.net/txt/copying/>
# Outputs a vertical bar chart from date-based JSON data
# Requires the JSON rubygem: `[sudo] gem install json`
require 'date'
require 'open-uri'
require 'rubygems'
require 'json'