Skip to content

Instantly share code, notes, and snippets.

View karstengresch's full-sized avatar
:octocat:
.

Karsten Gresch karstengresch

:octocat:
.
View GitHub Profile
@karstengresch
karstengresch / gist:0d4f8907af2366a3f881
Last active August 29, 2015 14:08 — forked from iandundas/gist:7863c6c248f76e14a3a8
German version, tested
# strip out iBooks citation
sed -E -e 's/^[ ]?[0-9]* //g' | sed -E -e 's/„[ ]?[0-9]?[ ]?//g' | sed -E -e 's/“$//g' | sed -E -e 's/^(Auszug aus).*//g'
import static java.lang.System.out;
import static java.util.Arrays.asList;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
public class ListTests {
public static void main( String[] args ) {
List<String> names = asList( "Ted", "Fred", "Jed", "Ned" );
@karstengresch
karstengresch / post_to_GitHub.py
Last active August 25, 2015 21:16 — forked from MalphasWats/post_to_GitHub.py
Post to GitHub Pages from Editorial
#coding: utf-8
import keychain
import console
import editor
import time
import re
import requests
import json
@karstengresch
karstengresch / get_blog_post.py
Last active August 25, 2015 21:16 — forked from MalphasWats/get_blog_post.py
Get blog post from GitHub Pages site in Editorial
#coding: utf-8
import keychain
import console
import editor
import time
import re
import requests
import json
@karstengresch
karstengresch / easy-k8s-coreos.md
Last active September 8, 2015 10:07 — forked from soellman/easy-k8s-coreos.md
Easy Kubernetes on CoreOS

Easy Kubernetes Installation on CoreOS

At Timeline Labs, we are continuously looking at new technologies to see what fits our needs. We are especially excited about Kubernetes from Google to manage our services atop Docker and CoreOS.

This process for installing Kubernetes on CoreOS uses Flannel for Kubernetes networking and should be cloud provider agnostic. To deploy the Kubernetes master functionality into the cluster, it uses fleetctl.

Thanks to Kelsey Hightower and his blog posts! They served as a great starting point for this process.

How do I get this running?

Add the cloud config below to your own and bring up your cluster using a CoreOS version with Docker 1.3 (currently v472.0.0 in alpha). During that initial boot, the download-kubernetes and download-flannel units will download binaries from the latest project release and use those.

@karstengresch
karstengresch / multiple_ssh_setting.md
Last active September 8, 2015 19:36 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
67 facebook-ios-sdk
48 Bolts-iOS
39 AFNetworking
38 Google-Mobile-Ads-SDK
38 Reachability (Apple)
37 Crashlytics
31 Flurry-iOS-SDK
30 CocoaPods
29 GoogleConversionTracking
26 SDWebImage
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@karstengresch
karstengresch / git2go-merge-local-branch.go
Created January 12, 2017 17:39 — forked from danielfbm/git2go-merge-local-branch.go
how to merge two local branches using git2go
package main
import (
"errors"
"log"
"github.com/libgit2/git2go"
)
func mergeBranches(repo *git.Repository, sourceBranchName string, destinationBranchName string) error {
// Assuming that these two branches are local already
sourceBranch, err := repo.LookupBranch(sourceBranchName, git.BranchLocal)
@karstengresch
karstengresch / Open in iTerm2
Last active January 17, 2017 19:50
Apple script to open an iterm2 "nightly" window from right-clicking on a file or folder in Finder. To use:(1) Open Automator(2) Create a new service(3) Change "Service receives selected" drop downs to "Files or folders" in "Finder"(4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
-- https://gist.github.com/shuntaroy/e5ce3ad61c0deb7e27f0
--
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
set dir_path to quoted form of (POSIX path of my_file)