Skip to content

Instantly share code, notes, and snippets.

View ariews's full-sized avatar

Arie W. Subagja ariews

View GitHub Profile
server {
listen 80;
index index.php;
server_name october.cms;
# root directory
root /path/to/octobercms;
location / {
server {
listen 80;
index index.php;
server_name new.project;
# root directory
# normal: /path/to/new.project/public
root /path/to/new.project;
# set url
@ariews
ariews / PapertrailServiceProvider.php
Created November 19, 2015 08:10
Laravel 5.1 Papertrail
<?php
# file: app/Providers/PapertrailServiceProvider.php
namespace App\Providers;
use Illuminate\Log\Writer;
use Illuminate\Support\ServiceProvider;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\SyslogUdpHandler;
/**
* Takes the given HTML data, replaces all its HTML tags with nothing, splits the result by spaces,
* and outputs the array length i.e. number of words.
*
* @param string htmlData HTML Data
* @return int Word Count
*/
function GetWordCount(htmlData) {
return htmlData.replace(/<(?:.|\s)*?>/g, '').split(' ').length;
}
/**
* Takes the given HTML data, replaces all its HTML tags with nothing, splits the result by spaces,
* and outputs the array length i.e. number of words.
*
* @param string htmlData HTML Data
* @return int Word Count
*/
function GetWordCount(htmlData) {
var count = 0;
[user@host] $ cd eggdrop1.6
[user@host] $ ./configure
[user@host] $ make config
[user@host] $ make
[user@host] $ make install
[user@host] $ cd ~/eggdrop
<?php
$directory_to_check = '/path/to/dir';
$DTs = array(realpath($directory_to_check));
$DSc = array();
while (count($DTs) > 0)
{
foreach ($DTs as $DKy => $std)
<?php
$k++;
$db_host[$k] = 'dbhost_1';
$db_name[$k] = 'dbname_1';
$db_user[$k] = 'dbuser_1';
$db_pass[$k] = 'dbpass_1';
$k++;
$db_host[$k] = 'dbhost_2';
<?php
function MyCounter () {
global $HTTP_COOKIE_VARS;
if (!is_file($this->DataFile)) {
$o = array ("1");
$this->insert($this->DataFile, $o);
}
if (!isset($HTTP_COOKIE_VARS['counter'])) {
login as: root
Sent username "root"
root@202.154.x.xxx's password:
Last login: Sun Oct 31 15:30:53 2004 from xxx.x.xxx.xx.xx
OpenBSD 3.1 (GENERIC) #59: Sat Apr 13 15:28:52 MDT 2002
Welcome to OpenBSD: The proactively secure Unix-like operating system.
Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest