Open ~/.bash_profile in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {| # If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! | |
| export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " | |
| # This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty! | |
| # ~/code/web:beta_directory$ git checkout master | |
| # Switched to branch "master" | |
| # ~/code/web:master$ git checkout beta_directory | |
| # Switched to branch "beta_directory" |
| # Autodict class | |
| # Create new autodict if accessing undefined key | |
| # support dot access syntax (mydict.test == mydict['test']) | |
| class autodict(dict): | |
| def __getitem__(self, name): | |
| if not name in self: | |
| dict.__setitem__(self, name, autodict()) | |
| return dict.__getitem__(self, name) | |
| def __getattr__(self, name): |
| wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1 | |
| # --no-check-cerftificate was necessary for me to have wget not puke about https | |
| curl -LJO https://github.com/joyent/node/tarball/v0.7.1 |
This gist contains lists of modules available in
in AWS Lambda.
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>Find the Discord channel in which you would like to send commits and other updates
In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe!
Unity's SerializedProperty not support custom type value setting. This extension use Reflection to get target instance of SerializedProperty in Custom Editor, made value setting of general type is posible.
| using UnityEngine; | |
| using System; | |
| public class MathParabola | |
| { | |
| public static Vector3 Parabola(Vector3 start, Vector3 end, float height, float t) | |
| { | |
| Func<float, float> f = x => -4 * height * x * x + 4 * height * x; |
| //Attach to player object | |
| using UnityEngine; | |
| using UnityEngine.Networking; | |
| using System.Collections; | |
| public class Voice : NetworkBehaviour | |
| { | |
| int lastSample; | |
| AudioClip c; |