Skip to content

Instantly share code, notes, and snippets.

<snippet>
<content><![CDATA[
echo '<pre>';
var_dump(${1:this});
echo '</pre>';
exit;
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>debug</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<snippet>
<content><![CDATA[
echo '<pre>';
var_dump(${1:this});
echo '</pre>';
exit;
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>debug</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->

This uses Twitter Bootstrap classes for CodeIgniter pagination.

Drop this file into application/config.

<?php
use Phake as p;
class MockingMailTest extends \TestCase
{
function test_it_should_send_mail()
{
// Mocking Laravel Mail
$mockedMail = p::mock('Illuminate\Mail\Mailer');
$this->app->instance('mailer', $mockedMail);
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
public function ceksmtp()
{
$fp = fsockopen("www.google.com", 80, $errno, $errstr, 10); // work fine
if (!$fp)
echo "www.google.com - $errstr ($errno)<br>\n";
else
echo "www.google.com - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 465, $errno, $errstr, 10); // NOT work
@acepsaepudin
acepsaepudin / 1-server.md
Created May 12, 2016 15:43 — forked from dragonjet/1-server.md
Setup Web Server on EC2 Amazon Linux AMI

Step 1: Server Credentials

This assumes you are now connected to the server via SSH.

  • sudo -s Enter root mode for admin access
  • groupadd devgroup Create new group to be later granted access to /var/www/html

Creating a new Root User

  • useradd -G root,devgroup masterdev Create new root user. Also add to the devgroup
  • passwd masterdev Change password for the new root user
  • At this point, you'll need to input your new root user's new password
<?php
/**
* Class Buku
* @author Acep Saepudin
*/
class Buku
{
private $penulis = 'Acep Saepudin';
@acepsaepudin
acepsaepudin / nginxproxy.md
Created May 20, 2016 22:46 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@acepsaepudin
acepsaepudin / DB.sql
Created July 14, 2016 16:36 — forked from msurguy/DB.sql
Dynamic dropdown in Laravel, let's say you have multiple drop downs (selects), you click on one and the contents of the other need to be dynamically changed. One solution is to dynamically load JSON from the API and change the dropdown dynamically depending on the user choice.
CREATE TABLE `makers` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--