Skip to content

Instantly share code, notes, and snippets.

View philib's full-sized avatar
🏠
Working from home

Philip Schäfer philib

🏠
Working from home
View GitHub Profile
@philib
philib / .fzf_git.zsh
Last active March 27, 2023 07:46
add git support to fzf with key bindings. `source` this script in your .zshrc to activate key bindings.
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --multi --ansi --reverse --keep-right --no-sort --height 100% "$@" --border
}
_gf() {
is_in_git_repo || return
@philib
philib / .fzf_jira.zsh
Last active January 13, 2021 08:10
fzf jira - fuzzy find KNUTH numbers
# Fuzzy find jira ticket numbers
# https://github.com/keepcosmos/terjira required
_jira_ticket() {
is_in_git_repo || return
local USER='PSH'
local JIRA_TICKET_REGEX='KNUTH-\w*'
jira issue jql "status = 'In Implementation' AND assignee = $USER AND type in ('Technical Task', 'Sub Bug')" | grep $JIRA_TICKET_REGEX | sed 's/│//g' | sed 's/In Implementation//' | fzf-down --layout reverse --info inline --preview "echo {} | grep -o '$JIRA_TICKET_REGEX' | xargs jira issue" --preview-window down:80% | grep -o $JIRA_TICKET_REGEX
}
is_in_git_repo() {
package dynamisch;
public class LaengsteAufsteigendeTeilfolge {
public static void main(String args[]) {
LaengsteAufsteigendeTeilfolge l = new LaengsteAufsteigendeTeilfolge();
int[] liste = {3, 5, 76, 1, 45, 2, 31, 89, 90, 0, 4, 12, 23, 47, 95, 21, 67, 8, 13, 11, 5, 145, 132, 77};
int[] liste2 = {3, 4, -1, 0, 6, 2, 3};
int[] folge = new int[liste.length];
package backtracking;
public class HausVomNikolaus {
int counter = 1;
public void solve(int[] vec, int stufe) {
for (int i = 1; i <= 5; i++) {
vec[stufe] = i;
if(movePossible(vec, stufe)){
package backtracking;
public class Kartenfaerben {
public boolean solve(int[][] karte, int[] faerbung, int farben, int stufe) {
for (int i = 0; i < karte.length; i++) {
if (karte[stufe][i] == 1 && faerbung[i] == 0) {
for (int farbe = 1; farbe <= farben; farbe++) {
faerbung[i] = farbe;
package backtracking;
/**
* Created by Phil on 01.07.2017.
*/
public class Fotoproblem {
int[] dx = {1, -1, 0, 0};
int[] dy = {0, 0, -1, 1};
package backtracking;
/**
* Created by Phil on 30.06.2017.
*/
public class Dameproblem {
public int count = 0;
public boolean isCandidate(int[][] brett, int zeile, int spalte){