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
// Route for authentication | |
Route::group(['namespace' => 'Auth'], function() { | |
Route::group(['prefix' => 'auth'], function() { | |
// Authentication routes... | |
get('login', 'AuthController@getLogin'); | |
get('logout', 'AuthController@getLogout'); | |
post('login', 'AuthController@postLogin'); | |
// Registration routes... | |
get('register', 'AuthController@getRegister'); |
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
if($request->hasFile('image')) | |
{ | |
$file = $request->file('image'); | |
$fileName = 'IMGP'.date('YmdHis').rand(1,100).'.'.$file->getClientOriginalExtension(); | |
$file->move('img/post', $fileName); | |
$data['image'] = $fileName; | |
} | |
else | |
{ | |
return redirect(route('admin.post').'/create')->withErrors(['Please choose the image to upload']); |
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 | |
if(! function_exists('form_model')) { | |
function form_model($object = false) | |
{ | |
return function($name) use ($object) | |
{ | |
if(!$object) return old($name); | |
else return isset($object) ? $object->$name : old($name); | |
}; | |
} |
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
Squash PR Commits to One Commit: | |
1. Clone branchnya (misalkan nama branchnya patch-1) | |
git clone http://github.com/repo --branch patch-1 D:/test | |
2. git pull origin patch-1 | |
3. git status, pastiin udah match origin ama local | |
4. Cek statusnya pake git log, pastikan commit yg mau digabung ada disana | |
5. git rebase -i HEAD~2 (2 berarti 2 commit terakhir) | |
6. Pas muncul, PASTIKAN cuma 2 commit yang kelist | |
# kalau isinya "noop" ato malah semua commit kelist: | |
# batalin aja: ctrl-c -> tutup buka lagi -> git rebase --abort |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^(.*)$ public/$1 [L] | |
</IfModule> |
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 "Installing composer dependencies..." | |
curl -sS https://getcomposer.org/installer | php | |
php composer.phar install --no-dev --ignore-platform-reqs | |
rm -f composer.phar | |
#rm -rf $OPENSHIFT_HOMEDIR/app-root/build-dependencies/.npmrc | |
#mkdir -p $OPENSHIFT_HOMEDIR/app-root/build-dependencies/.npmrc | |
#export NPM_CONFIG_USERCONFIG=$OPENSHIFT_HOMEDIR/app-root/build-dependencies/.npmrc | |
#rm -rf $OPENSHIFT_HOMEDIR/app-root/build-dependencies/.npm | |
#mkdir -p $OPENSHIFT_HOMEDIR/app-root/build-dependencies/.npm |
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
#!/bin/bash | |
ID_RSA="$OPENSHIFT_DATA_DIR/.ssh/id_rsa" | |
KNOWN_HOSTS="$OPENSHIFT_DATA_DIR/.ssh/known_hosts" | |
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $ID_RSA $1 $2 |
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
# JavaScript Design Pattern | |
## Prototype Inheritance | |
function __extends(Child, Parent) { | |
Child.prototype = new Parent(); | |
} | |
function Person(name) { | |
this.name = name; | |
this.hello = function() { |
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 fetch origin # Updates origin/master | |
git rebase origin/master # Rebases current branch onto origin/master | |
git rebase -i HEAD~3 # Rebases last 3 commits |
OlderNewer