Skip to content

Instantly share code, notes, and snippets.

View samayo's full-sized avatar
💬
drink more water

Samson Daniel samayo

💬
drink more water
View GitHub Profile
@samayo
samayo / gist:8339642
Created January 9, 2014 18:46
testing visithor
<?php
class VisiThorGraph{
function __construct($myFile){
$this->myFile = new SplFileObject($myFile);
}
function getTotalCount(){
$count = null;
while(!$this->myFile->eof()){
$explode = explode('#', str_replace("\n", "", $this->myFile->fgets()));
if(!empty($explode[1])){
@samayo
samayo / gist:9504908
Created March 12, 2014 11:15
Comparing style
<?php
$a->crop(["width"=>100, "height"=>100])
->watermark('logo.png')
->upload($_FILES["name"]);
# compare with below approach.
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@samayo
samayo / init.d
Created October 11, 2014 13:42
init.d
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
@samayo
samayo / bash
Created December 18, 2014 15:36
mariadb error
$ yum -y update
$ yum -y install cmake glibc.i686 ncurses-devel
$ wget https://downloads.mariadb.org/f/mariadb-5.5.40/source/mariadb-5.5.40.tar.gz
$ tar xzvf mariadb-5.5.40.tar.gz
$ cd mariadb-5.5.40
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mariadb -DMYSQL_TCP_PORT=3306 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/usr/local/mariadb/data -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATEDX_STORAGE_ENGINE=1 -DWITH_ARIA_STORAGE_ENGINE=1 -DWITH_XTRADB_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DENABLED_LOCAL_INFILE=1 -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_SSL=bundled -DWITH_ZLIB=system
@samayo
samayo / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@samayo
samayo / init
Created April 11, 2015 22:13
nginx daemon
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# pidfile: /var/run/nginx.pid
server {
listen 80;
server_name example.com dev.example.com;
root /var/www/sites/public/dev.example/;
index index.html index.htm index.php;
access_log /var/log/nginx/example.com_access.log;
error_log /var/log/nginx/example.com_error.log;
charset utf-8;
@samayo
samayo / nginx.conf
Created April 11, 2015 23:34
Nginx configuration file
user nginx;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {