- Generate a GitHub Access Token with
repo:status
access. - Put
gitpr.py
in a scripts directory (I use~/scripts/python/
) and update it with your github access token. - Save
gitpr
as/usr/bin/gitpr
and make it executable (chmod +x /usr/bin/gitpr
). Then update the value ofscripts_dir
to the directory you savedgitpr.py
in. - Optional: Install pyperclip with
sudo pip install pyperclip
. If pyperclip is detected, the link to the Pull Request on GitHub will be copied to your clipboard. - Optional: if you are using a repository that takes Pull Requests at a branch other than master, you will have to add the repository to the
target_branches
dict with the repo as the key and the target branch as the value. See the code for an example.
This file contains 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
//XOR logic | |
var xor = new NeuralNetwork( Array( 2, 3, 1 ) ) | |
xor.train( 10000, Map( Array(0.0,1.0)->Array(1.0),Array(1.0,0.0)->Array(1.0),Array(1.0,1.0)->Array(0.0),Array(0.0,0.0)->Array(0.0))) | |
xor.truth_table() | |
//Rudimentary OCR | |
val zero = Array[Double](0,1,1,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,1,1,0) | |
val two = Array[Double](0,1,1,1,0,0,0,0,1,0,0,1,1,1,0,0,1,0,0,0,0,1,1,1,0) |
This file contains 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
<?php | |
class image | |
{ | |
public $registry; | |
public function resize( $new_img, $tempFile, $saveTo, $MaxWidth, $MaxHeight ) | |
{ | |
$path = pathinfo( $saveTo ); |
This file contains 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(){ | |
$('.autocomplete .input').live("propertychange keydown keypress keyup input paste focus click", function(e){ | |
e.stopImmediatePropagation(); | |
e.stopPropagation(); | |
var $parent = $(this).parents('.autocomplete'); | |
var $dropdown = $parent.find('.dropdown'); | |
if( $dropdown.length === 0 ) | |
{ |
- Put
gitbr
in/usr/local/bin
. - If necessary, replace
master
andorigin
with the main branch and remote of the repository. - Make it executable (
chmod +x /usr/local/bin/gitbr
).
- Run
gitbr
with no arguments to have the branch name generated for you (e.g.04-13-001274741-2015
). - Run
gitbr
to use a specific branch name.
Add a root namespace (e.g. App) to a Laravel project that doesn't have one.
([\s])([\\']{0,1})(Console|Events|Exceptions|Handlers|Helpers|Http|Models|Providers|Services)([\\;])
->
$1$2App\\$3$4
This file contains 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
echo "# Disable IPV6" >> /etc/sysctl.conf | |
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf | |
echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf | |
echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf | |
echo "net.ipv6.conf.eth0.disable_ipv6 = 1" >> /etc/sysctl.conf |
This file contains 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
git pull origin HEAD | |
# http://stevenharman.net/git-clean-delete-already-merged-branches | |
git branch --merged develop | grep -v "master" | grep -v "develop" | xargs -n 1 git branch -d | |
git branch |
This file contains 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
Set colNamedArguments = WScript.Arguments.Named | |
url = colNamedArguments.Item("url") | |
data = "" | |
ContentType = "application/x-www-form-urlencoded" | |
If colNamedArguments.Exists("method") Then | |
method = colNamedArguments.Item("method") | |
Else | |
method = "GET" |
This file contains 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
<?php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Schema\Builder; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateSomeRelation extends Migration | |
{ | |
/** | |
* @var Builder |
OlderNewer