Skip to content

Instantly share code, notes, and snippets.

View RoesWibowo's full-sized avatar
💰
Available for hire!

Roes Wibowo RoesWibowo

💰
Available for hire!
View GitHub Profile
@RoesWibowo
RoesWibowo / validation.php
Last active November 11, 2020 16:06
Laravel 4 Validation Message Bahasa Indonesia
<?php
return array(
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
@RoesWibowo
RoesWibowo / command
Last active August 29, 2015 14:02
Git Command
* Prepare local git:
`git remote add origin url`
* Update local:
`git pull origin [branch]`
`git push origin [branch]`
@RoesWibowo
RoesWibowo / basic.js
Created July 22, 2014 03:08
jQuery Ajax Basic
$.ajax({
url: url,
type: "GET",
success: function(callback){
}, error: function() {
}
});
@RoesWibowo
RoesWibowo / composer.json
Created October 12, 2014 15:51
Solve composer install/update error because packagist json doesn't macth it's signature.
"repositories": {
"packagist": {
"url": "https://packagist.org",
"type": "composer"
}
}
@RoesWibowo
RoesWibowo / .bashsrc
Created May 7, 2015 04:33
Bash alias for my local server
alias dumpautoload="composer dump-autoload"
alias artisan="php artisan"
alias helper-generate="php artisan ide-helper:generate"
alias doctrine-orm="php cli-config.php"
@RoesWibowo
RoesWibowo / Vagrantfile
Last active August 29, 2015 14:22
My vagrant configuration
Vagrant.configure(2) do |config|
# set base box
config.vm.box = "ubuntu/trusty64"
# disable update
config.vm.box_check_update = false
# set port forwarder
config.vm.network "forwarded_port", guest: 22, host: 22
config.vm.network "forwarded_port", guest: 80, host: 80
@RoesWibowo
RoesWibowo / function
Created July 12, 2015 09:51
Save base64 encoded files
/**
* @param $fileString
* @param $location
* @param $filename
* @return array
*/
function saveFile($fileString, $location, $filename) {
$result = [];
$split = explode(';', $fileString);
@RoesWibowo
RoesWibowo / function.php
Created July 31, 2015 07:07
Convert http, https, ftp to link in a text
<?php
function convertTextWithLink($text) {
$result = preg_replace('%(((f|ht){1}tp[s]?://)[-a-zA-^Z0-9@:\%_\+-.,!~#?&//=]+)%i','<a href="\\1" target="_blank">\\1</a>', $text);
return $result;
}
@RoesWibowo
RoesWibowo / .htaccess
Created April 5, 2016 15:14
Serve static files AngularJS 2
# BEGIN ServeStatic
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
@RoesWibowo
RoesWibowo / gist:5b13e53125dc20b5caeb60c5ac134065
Created April 10, 2016 12:06
Fix supervisor `unix:///var/run/supervisor.sock no such file`
$ supervisorctl restart
unix:///var/run/supervisor.sock no such file
$ pgrep -fl supervisor
$ sudo touch /var/run/supervisor.sock
$ sudo chmod 777 /var/run/supervisor.sock
$ sudo service supervisor restart