This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! VundleVisitPluginPage(plugin_name) | |
| if !exists('g:vundle#bundles') | |
| echomsg 'Could not find Vundle plugins' | |
| return | |
| endif | |
| if !exists('g:web_browser') | |
| echomsg 'Set your web browser executable to g:web_browser' | |
| return | |
| endif | |
| let uri = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Custom terminfo for better using tmux with urxvt, 256colors and italics | |
| # Compile/install with `tic tmux.terminfo`, then set $TERM to "tmux" | |
| # (it requires a program that uses `tgetent` to obtain terminal | |
| # information) | |
| tmux|tmux with rxvt-unicode-256color client, | |
| use=rxvt-unicode-256color, | |
| use=screen, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ssh-agent-start() | |
| { | |
| local agentfile=~/.ssh/agent | |
| if [[ -f $agentfile ]] | |
| then | |
| source $agentfile > /dev/null | |
| if ps -p "$SSH_AGENT_PID" > /dev/null | |
| then | |
| echo "Agent running with PID $SSH_AGENT_PID" | |
| return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def make_invalid_model(model_class, **kwargs): | |
| """ | |
| create a model object bypassing all member validation | |
| :param model_class: the class of the generated model that needs to be instantiated | |
| :param kwargs: all the model parameters, as they would be passed to the constructor | |
| :return: an instance of model_class | |
| """ | |
| def get_default_values(model_class, attributes): | |
| signature = inspect.signature(model_class.__init__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # The "tmuxifier" | |
| # Execute parallel processes in an arbitrary number of tmux panes | |
| # This script requires the path to an existing script to | |
| # execute in parallel. Optionally, the number of threads to | |
| # and the name of the tmux session can be input. If threads | |
| # and session name are not entered, threads are determined | |
| # automatically and session names is set to a default. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import argparse | |
| counter = 0 | |
| def next(): | |
| global counter | |
| counter += 1 | |
| return counter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| import pytest | |
| def camel_to_snake(string): | |
| s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', string) | |
| return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() | |
| CASES = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import uuid | |
| from sqlalchemy import Column, String, create_engine, CHAR | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.orm import sessionmaker | |
| engine = create_engine('sqlite:///:memory:', echo=True) | |
| Base = declarative_base() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $oldPath = (Get-ItemProperty -Path ` | |
| 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' ` | |
| -Name PATH).path | |
| $pathParts = $oldPath.split(";") | |
| $python = @() | |
| $other = @() | |
| foreach ($part in $pathParts) { | |
| if ($part -like "*Python*") { | |
| $python += ,$part | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| def die(*messages, rc=1): | |
| """ | |
| Print the arguments in stderr and exit with a given return code | |
| """ | |
| print(*messages, file=sys.stderr) | |
| sys.exit(rc) |