Skip to content

Instantly share code, notes, and snippets.

View konstantinbe's full-sized avatar

Konstantin Bender konstantinbe

View GitHub Profile
@konstantinbe
konstantinbe / keybase.md
Created September 30, 2014 12:36
Verifying myself on Keybase.io

Keybase proof

I hereby claim:

  • I am konstantinbe on github.
  • I am konstantinbe (https://keybase.io/konstantinbe) on keybase.
  • I have a public key whose fingerprint is 14B1 F90F C025 7423 43B6 7010 1338 E0C9 6628 C4F2

To claim this, I am signing this object:

@konstantinbe
konstantinbe / .gitconfig
Last active August 29, 2015 14:06
git-auto-commit
...
[alias]
...
ac = auto-commit
...
@konstantinbe
konstantinbe / Rakefile
Last active December 16, 2015 09:29
Building Mac apps with Rake (no Xcode)
#
# Copyright (c) 2013 Konstantin Bender.
#
require 'rubygems'
# ------------------------------------------------------------- Constants ------
NAME = ENV['name'] || "ExampleAppMac"
TARGET = ENV['target'] || "test"
@konstantinbe
konstantinbe / KBMenuStyleHighlightTableRowView.m
Last active December 13, 2015 21:19
Menu style highlighting for table row views
- (void)drawSelectionInRect:(NSRect)rect {
if (self.selectionHighlightStyle == NSTableViewSelectionHighlightStyleNone) return;
NSColor *borderColorTop = [NSColor colorWithCalibratedHue:229.0 / 360.0 saturation:0.70 brightness:0.92 alpha:1.0];
NSColor *borderColorBottom = [NSColor colorWithCalibratedHue:228.5 / 360.0 saturation:0.955 brightness:0.90 alpha:1.0];
NSColor *gradientColorTop = [NSColor colorWithCalibratedHue:229.0 / 360.0 saturation:0.66 brightness:0.97 alpha:1.0];
NSColor *gradientColorBottom = [NSColor colorWithCalibratedHue:229.0 / 360.0 saturation:0.90 brightness:0.95 alpha:1.0];
NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations:gradientColorTop, 0.0, gradientColorBottom, 1.0, nil];
const CGRect bounds = self.bounds;
@konstantinbe
konstantinbe / git-backup
Created October 10, 2012 15:00
Backing Up Repos
#!/usr/bin/env ruby
#
# Copyright (c) 2012 Konstantin Bender.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@konstantinbe
konstantinbe / gist:1642358
Created January 19, 2012 20:25
Serious C99 macro magic
#define CRString(string) (ID){.pointer = (CRPointer)(CRStringStructure[1]){{.behavior = (CRBehaviorStructure*)&CRStringClass, .retainCount = CRNaturalMax, .capacity = sizeof(string) / sizeof(CRChar), .length = sizeof(string) / sizeof(CRChar), .characters = string}}, .payload.natural = 0}
@konstantinbe
konstantinbe / github-upload.rb
Created August 11, 2011 11:51 — forked from wereHamster/README.md
Script to upload files to github: ./github-upload.rb <file> [<repo>]
#!/usr/bin/env ruby
# Die if something goes wrong
def die(msg); puts(msg); exit!(1); end
# Login credentials
login = `git config --get github.user`.chomp
token = `git config --get github.token`.chomp
# The file we want to upload