Skip to content

Instantly share code, notes, and snippets.

View jeremija's full-sized avatar

Jerko Steiner jeremija

View GitHub Profile
@datagrok
datagrok / git-branch-simplify.md
Last active April 16, 2024 17:26
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@mrfr0g
mrfr0g / d3.selection.tooltip.js
Created July 10, 2013 16:58
Simple modification of Bootstrap's tooltip method to allow tooltips on arbitrary d3 selections. Usage example, d3.selectAll('g.circle') .tooltip(); // Looks at the `tooltip` property of the datum. d3.selectAll('g.circle') .tooltip('Uses this value as the tooltip for the selection'); d3.selectAll('g.circle') .tooltip(function (d) {return 'any val…
(function () {
// Bootstrap provided getPosition uses offsetWidth and offsetHeight to calculate
// the positioning of the tooltip. SVG Elements do not have this property because
// SVG does not layout elements, it assumes elements are always positioned.
// This replaces their implementation for SVG elements, and utilizes getBoundingClientRect.
var getPosition = $.fn.tooltip.Constructor.prototype.getPosition;
$.fn.tooltip.Constructor.prototype.getPosition = function (inside) {
var svgParent = this.$element.parents('svg');
// Only apply to SVG children
// Test for iOS 3/BlackBerry
@stbuehler
stbuehler / fix_umask.c
Created January 21, 2014 13:38
Workaround sublime text 3 umask bug, always adding 0022 to the mask (deny write to group/others) with LD_PRELOAD hack.
/*
compile with:
gcc -shared -fPIC fix_umask.c -o fix_umask.so
edit /usr/bin/subl to include (fix the path to fix_umask.so if necessary):
#!/bin/sh
export LD_PRELOAD=/opt/sublime_text/fix_umask.so
exec /opt/sublime_text/sublime_text "$@"
import CoreGraphics
func printDisplays() {
var displayCount: UInt32 = 0;
var result = CGGetActiveDisplayList(0, nil, &displayCount)
if (result != 0) {
println("error: \(result)")
return
}
let allocated = Int(displayCount)
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import java.beans.PropertyDescriptor;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
public class Jsr310SupportedBeanPropertyRowMapper<T> extends BeanPropertyRowMapper<T> {
@juanmiret
juanmiret / init.lua
Last active July 23, 2018 18:18
Simple Vi mode with Karabiner-elements and Hammerspoon
local module = {}
module.debugging = false -- whether to print status updates
local eventtap = require "hs.eventtap"
local event = eventtap.event
local inspect = require "hs.inspect"
local keyHandler = function(e)
local watchFor = {
rofi.color-window: argb:EE373B47, #373B47
rofi.color-normal: argb:00373B47, #737783, argb:00373B47, argb:00373B47, #f9f9f9
rofi.color-urgent: argb:00373B47, #cc6666, argb:e54b5160, argb:00373B47, #f9f9f9
rofi.color-active: argb:00373B47, #65acff, argb:e44b5160, argb:00373B47, #f9f9f9
rofi.width: 30
rofi.lines: 16
rofi.font: Open Sans Light 25
rofi.bw: 0
rofi.padding: 40
rofi.eh: 1