Skip to content

Instantly share code, notes, and snippets.

View blueyed's full-sized avatar
💭
❤️ not eating nor abusing animals 🍀

Daniel Hahler blueyed

💭
❤️ not eating nor abusing animals 🍀
View GitHub Profile
@othree
othree / switchCase.vim
Created May 27, 2013 07:08
Switch between different case type: camelCase -> MixedCase -> snake_case -> UPPER_CASE -> dash-case -> camelCase
let g:switch_custom_definitions =
\ [
\ {
\ '\<\(\l\)\(\l\+\(\u\l\+\)\+\)\>': '\=toupper(submatch(1)) . submatch(2)',
\ '\<\(\u\l\+\)\(\u\l\+\)\+\>': "\\=tolower(substitute(submatch(0), '\\(\\l\\)\\(\\u\\)', '\\1_\\2', 'g'))",
\ '\<\(\l\+\)\(_\l\+\)\+\>': '\U\0',
\ '\<\(\u\+\)\(_\u\+\)\+\>': "\\=tolower(substitute(submatch(0), '_', '-', 'g'))",
\ '\<\(\l\+\)\(-\l\+\)\+\>': "\\=substitute(submatch(0), '-\\(\\l\\)', '\\u\\1', 'g')",
\ }
\ ]
@davidfraser
davidfraser / venv_link.py
Last active June 2, 2017 20:30
Script to link Python system package into virtual environment from Nick Coghlan at https://bitbucket.org/ncoghlan/misc/raw/44341af0b2e4ac7f9580d5f907d8f49c7013b3b9/venv_link.py Modified to use system python to find the module, and pip to decide the link location
@pkrusche
pkrusche / versioning.py
Created November 8, 2013 10:37
Git version in Python
#!/usr/bin/env python
""" Git Versioning Script
Will transform stdin to expand some keywords with git version/author/date information.
Specify --clean to remove this information before commit.
Setup:
@magopian
magopian / conftest.py
Created November 27, 2013 10:46
Little hack for pytest_django: load data in your test database before the tests are run, only if the database is being created and not reused.
import pytest
@pytest.fixture(scope='session')
def _django_db_setup(request, _django_db_setup, _django_cursor_wrapper):
"""Load any data needed for the tests after the database is created.
This "overwrites" pytest_django's own _django_db_setup.
"""
@rgbkrk
rgbkrk / hubdecrypt.sh
Last active April 6, 2022 02:55
Encrypt a (short) file using someone's public key from github
#!/usr/bin/env bash
# HubCrypt
# ========
#
# Decrypt a file encrypted using hubencrypt (ok, it's just openssl + rsautl +
# your SSH keys). It needs the private key that matches your last public key
# listed at github.com/<user>.keys
#
@tarruda
tarruda / .ycm_extra_conf.py
Created January 16, 2014 17:48
YouCompleteMe configuration for vim source code (.ycm_extra_conf.py)
# .ycm_extra_conf.py for vim source code. This should work after running './configure
import os, re
def create_flags():
rv = [
'-Wall',
'-Wextra',
'-std=c89',
'-x',
@sjl
sjl / zl.vim
Created January 17, 2014 17:46
Zip Right Vim mapping
" Zip Right
"
" Moves the character under the cursor to the end of the line. Handy when you
" have something like:
"
" foo
"
" And you want to wrap it in a method call, so you type:
"
" println()foo
@akkartik
akkartik / ondemandhighlight.vim
Last active January 4, 2016 15:39
Highlight a word from inside vim. The color is chosen at random but persisted across sessions.
" Highlight a word from inside vim. The color is chosen at random but
" persisted across sessions.
" By Kartik Agaram -- http://akkartik.name -- ondemandhighlight@akkartik.com
" Experimenting with an idea by Evan Brooks: https://medium.com/p/3a6db2743a1e
" Discussion: http://www.reddit.com/r/programming/comments/1w76um/coding_in_color
let highlight_file = &viewdir."/highlights"
if !filereadable(highlight_file)
call system("mkdir -p ".&viewdir)
@soarez
soarez / ca.md
Last active May 3, 2024 00:04
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@bitjockey42
bitjockey42 / mopidy.md
Created April 20, 2014 16:39
An installation and setup guide for mopidy on Arch Linux.

Mopidy on Arch Linux

mopidy

Installation

Install from the AUR.