Skip to content

Instantly share code, notes, and snippets.

View virbo's full-sized avatar
💭
I may be slow to respond.

Yusuf Ayuba virbo

💭
I may be slow to respond.
View GitHub Profile
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteRule . index.php
<?php
namespace app\controllers;
use Yii;
use yii\web\Controller;
use app\models\Soapmodel;
/**
* Site Controller
@virbo
virbo / pdf-thumbnail-php.md
Created July 28, 2016 12:38 — forked from umidjons/pdf-thumbnail-php.md
Creating PDF thumbnails in PHP

Creating PDF thumbnails in PHP

Install Ghostscript

Download and install right version of ghostscript. In my case my PHP was x86 architecture, so I download Ghostscript 9.14 for Windows (32 bit).

Enable ImageMagick

<?php
use yii\db\Schema;
class m160804_160101_history extends \yii\db\Migration
{
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
io.on('connection', function(socket){
console.log('new client connected');
socket.on('disconnet', function(){
console.log('a client disconnect');
})
socket.on('notif',function(msg){
return [
'class' => 'yii\db\Connection',
'dsn' => 'pgsql:host=localhost;dbname=test',
'username' => 'user_database',
'password' => 'password_database',
'charset' => 'utf8',
];
@virbo
virbo / ws_insert.php
Last active December 3, 2017 04:37
WSFeeder insert mahasiswa dan riwayat pendidikan
<?php
public function actionInsert()
{
$rec = [
'nama_mahasiswa' => 'Yusuf Ayuba',
'jenis_kelamin' => 'L',
'tempat_lahir' => 'Tanobonunungan',
'tanggal_lahir' => '1980-08-23',
'id_agama' => 1,
@virbo
virbo / php_upgrade_to_71.sh
Last active January 21, 2018 13:33 — forked from pixeline/php_upgrade_to_71.sh
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew --> http://brew.sh/
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick php71-pdo-pgsql
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
@virbo
virbo / LC_CTYPE.txt
Created February 21, 2018 03:10 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@virbo
virbo / pdo_pgsql.c
Created February 28, 2018 03:10
Install pdo_pgsql in CWP
1. Download file binary PHP dari http://php.net/downloads.php (sesuaikan dengan versi php yang digunakan)
2. Extract file tersebut, kemudian masuk ke folder ext/pdo_pgsql
3. konfigurasi kembali php dengan perintah
~~
phpize
./configure --with-pdo-pgsql
make && make install
~~
4. restart apache
5. pdo_pgsql telah aktif