This article is now published on my website: Prefer Subshells for Context.
class FullPaths(argparse.Action): | |
"""Expand user- and relative-paths""" | |
def __call__(self, parser, namespace, values, option_string=None): | |
setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values))) | |
def is_dir(dirname): | |
"""Checks if a path is an actual directory""" | |
if not os.path.isdir(dirname): | |
msg = "{0} is not a directory".format(dirname) | |
raise argparse.ArgumentTypeError(msg) |
/* | |
* drivertest.cpp | |
* Vector addition (host code) | |
* | |
* Andrei de A. Formiga, 2012-06-04 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
#!/bin/sh | |
INFO=$(xwininfo -frame) | |
WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' |\ | |
grep -oEe '[0-9]+x[0-9]+') | |
WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' |\ | |
grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/+/,/' ) | |
ffmpeg -f x11grab -y -r 15 -s $WIN_GEO -i :0.0+$WIN_XY -vcodec ffv1 -sameq -f alsa -ac 2\ |
##git mergetool
In the middle file (future merged file), you can navigate between conflicts with ]c
and [c
.
Choose which version you want to keep with :diffget //2
or :diffget //3
(the //2
and //3
are unique identifiers for the target/master copy and the merge/branch copy file names).
:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
""" | |
MIT License | |
Copyright (c) 2017 Cyrille Rossant | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
// go build -ldflags "-s -w" -o index.cgi cgi.go | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"net/http/cgi" | |
) |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
From a comment on StackOverflow:
Vendoring is the moving of all 3rd party items such as plugins, gems and even rails into the /vendor directory. This is one method for ensuring that all files are deployed to the production server the same as the dev environment.
The activity described above, on its own, is fine. It merely describes the deployment location for various resources in an application.