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
# rename the local branch to the new name | |
git branch -m old_name new_name | |
# delete the old branch on remote - where <remote> is eg. origin | |
git push <remote> --delete old_name | |
# push the new branch to remote | |
git push <remote> new_name |
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
SELECT nextval('releases_id_seq'::regclass); |
I occasionally need the list of method parameter matchers when setting assertions via mocks using with(). A completely useless example:
$foo->expects($this->once())
->method('setter')
->with($this->isType('string'));
I can see a few documented in the examples but the most conclusive list I’ve come across is from slide 11 of these Advanced PHPUnit Testing slides. So I am posting them here, if only for my own use:
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Teste de parametros</title> | |
<style type="text/css"> | |
.with-black-firday {display:none;} | |
</style> | |
</head> | |
<body> |
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
$files = glob(public_path('images/highlights/svg/*')); | |
foreach($files as $file) { | |
$fileInfo = pathinfo($file); | |
$renameTo = str_slug($fileInfo['filename']); | |
rename($file, $fileInfo['dirname'] . '/' . $renameTo . '.' . $fileInfo['extension']); | |
echo $fileInfo['dirname'] . '/' . $renameTo . '.' . $fileInfo['extension'] . '<br>'; |
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
var gulp = require('gulp'), | |
uglify = require('gulp-uglify'), | |
cssmin = require('gulp-cssmin'), | |
importcss = require('gulp-import-css'), | |
concat = require('gulp-concat'), | |
include = require('gulp-include'), | |
compass = require('gulp-compass'), | |
rename = require('gulp-rename'), | |
livereload = require('gulp-livereload'); |
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
class Article extends Model | |
{ | |
protected $fillable = ['title', 'slug', 'content', 'excerpt', 'tags', 'image', 'template', 'seo_title', 'seo_description', 'status']; | |
protected $casts = ['status' => 'boolean']; | |
/** | |
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany | |
*/ | |
public function categories() |
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
'use strict'; | |
angular.module('cms', [ | |
'ngRoute' | |
]) | |
.constant('API', { | |
"route": function(name) { | |
return '/admin/api/'+name; | |
} | |
}) |
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 -e | |
# IMPORTANT. My phpstom installation exists on /opt/phpstorm. | |
# IMPORTANT. Run with sudo! | |
# Early Access program: https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program | |
echo -n "Please enter the PhpStorm download url (eg http://download.jetbrains.com/webide/PhpStorm-EAP-141.690.tar.gz): " | |
read url | |
# Download file from url | |
echo "Downloading PhpStorm to ~/Desktop" |