Skip to content

Instantly share code, notes, and snippets.

View jrd's full-sized avatar
:octocat:
Working

Cyrille Pontvieux jrd

:octocat:
Working
View GitHub Profile
" -*- vim: set sts=2 sw=2 et fdm=marker: ------------- vim modeline -*-
" [Pathogen] ------------------------------------------ {{{1
" call pathogen#infect()
" Basic Settings -------------------------------------- {{{1
syntax on
set nocompatible
filetype plugin indent on
set hlsearch
@canton7
canton7 / 0main.md
Created September 17, 2012 12:57
Git Bisect and Feature Branches

Git Bisect and Feature Branches

There are people out there who claim that merge-based workflows (that is, workflows which contain non-fast-forward merges) are bad. They claim that git bisect gets confused by merge-based workflows, and instead advocate rebase-based workflows without explicit feature branches.

They're wrong.

Furthermore, the "advantages" of their workflows are in fact disadvantages. Let me show you.

@mislav
mislav / _readme.md
Last active September 28, 2024 23:03
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@saik0
saik0 / 90-uinput.rules
Last active April 8, 2016 23:00
xboxdrv: Xbox 360 Wireless Receiver with up to four gamepads
# Set the ownership and permissions for the uinput device
KERNEL=="uinput", OWNER="root", GROUP="uinput", MODE="0660"
@pdemanget
pdemanget / JpaMain.java
Last active October 24, 2016 21:43
JPA standalone
package com.viseo.cv.jpa;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
@wjordan
wjordan / dockerize.sh
Last active June 22, 2020 15:47
Dockerize: A tiny replacement for Dockerfiles
#!/bin/sh
####
# Dockerize: A tiny replacement for Dockerfiles
# This script leverages `docker run` and `docker commit` to provide a usable workaround for
# restrictions of `docker build` and Dockerfile syntax to strictly host-independent builds.
#
# See these discussions:
# https://github.com/docker/docker/pull/1124
# https://github.com/docker/docker/issues/3156
# https://github.com/docker/docker/issues/3949
@Bekbolatov
Bekbolatov / tmux.md
Last active October 7, 2024 04:03
Clean tmux cheat-sheet

Clean tmux cheat-sheet

By resources

sessions

list-sessions        ls         -- List sessions managed by server
new-session          new        -- Create a new session
@iimos
iimos / xpath.js
Last active June 24, 2024 17:05
Micro function that gives xpath by element and elements by xpath.
function xpath(el) {
if (typeof el == "string") return document.evaluate(el, document, null, 0, null)
if (!el || el.nodeType != 1) return ''
if (el.id) return "//*[@id='" + el.id + "']"
var sames = [].filter.call(el.parentNode.children, function (x) { return x.tagName == el.tagName })
return xpath(el.parentNode) + '/' + el.tagName.toLowerCase() + (sames.length > 1 ? '['+([].indexOf.call(sames, el)+1)+']' : '')
}
// Usage:
@kalbasit
kalbasit / debug info
Last active July 8, 2018 09:04
Nginx Reverse Proxy
$ docker --version
Docker version 1.11.1, build 5604cbe
$ uname -a
Linux hermes 4.5.1-1-ARCH #1 SMP PREEMPT Thu Apr 14 19:19:32 CEST 2016 x86_64 GNU/Linux
$ cat /etc/os-release
NAME="Arch Linux"
ID=arch
PRETTY_NAME="Arch Linux"
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
@leonidessaguisagjr
leonidessaguisagjr / py-git-cat-file.py
Last active July 30, 2023 06:46
Studying git internals: implement `git cat-file` in Python
#!/usr/bin/env python3
"""Implementation of git cat-file in Python.
This Gist is published under the MIT License:
MIT License
Copyright (c) 2019 Leonides T. Saguisag, Jr.
Permission is hereby granted, free of charge, to any person obtaining a copy