- Generate a GitHub Access Token with
repo:statusaccess. - Put
gitpr.pyin a scripts directory (I use~/scripts/python/) and update it with your github access token. - Save
gitpras/usr/bin/gitprand make it executable (chmod +x /usr/bin/gitpr). Then update the value ofscripts_dirto the directory you savedgitpr.pyin. - 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_branchesdict with the repo as the key and the target branch as the value. See the code for an example.
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
| //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 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
| <?php | |
| class image | |
| { | |
| public $registry; | |
| public function resize( $new_img, $tempFile, $saveTo, $MaxWidth, $MaxHeight ) | |
| { | |
| $path = pathinfo( $saveTo ); |
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(){ | |
| $('.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
gitbrin/usr/local/bin. - If necessary, replace
masterandoriginwith the main branch and remote of the repository. - Make it executable (
chmod +x /usr/local/bin/gitbr).
- Run
gitbrwith no arguments to have the branch name generated for you (e.g.04-13-001274741-2015). - Run
gitbrto 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 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
| 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 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
| 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 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
| 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 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
| <?php | |
| use Illuminate\Database\Schema\Blueprint; | |
| use Illuminate\Database\Schema\Builder; | |
| use Illuminate\Database\Migrations\Migration; | |
| class CreateSomeRelation extends Migration | |
| { | |
| /** | |
| * @var Builder |
OlderNewer