Skip to content

Instantly share code, notes, and snippets.

View apampolino's full-sized avatar

apampolino apampolino

  • Manila, Philippines
View GitHub Profile
@apampolino
apampolino / pagination.js
Created November 7, 2018 13:46
Simple javacript pagination
let row_keys = ['CALID'];
let pagination = new Pagination({
container: '#nav-list .pagination',
resultContainer: '#nav-list .pagination-results',
query: [{limit:10}],
keys: row_keys,
dataContainer: '#lineID_list',
sideLinks: 2,
buttonDisplay: 5,
@apampolino
apampolino / laravel-packages.txt
Created October 10, 2018 06:14
Laravel packages for development
Carbon
LaRecipe
Akaunting
@apampolino
apampolino / preference.sublime-settings
Last active January 18, 2019 16:05
Sublime text 3 user settings
{
"adaptive_dividers": true,
"always_prompt_for_file_reload": false,
"always_show_minimap_viewport": false,
"animation_enabled": true,
"atomic_save": false,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_cycle": false,
@apampolino
apampolino / gcc.sublime-build
Created October 1, 2018 15:04
C compilation setup for sublime text 3
{
"shell_cmd" : "gcc.exe *.c -o ${file_base_name}",
"working_dir" : "$file_path",
"variants":
[
{
"name": "C_RUN",
"shell_cmd": "gcc *.c -o ${file_base_name} && ${file_path}/${file_base_name}"
}
]
@apampolino
apampolino / socket_client.php
Created September 27, 2018 12:33
PHP sockets
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
if (!extension_loaded('sockets')) {
die('Sockets extention not loaded');
}
@apampolino
apampolino / nodeserver.conf
Created September 19, 2018 07:46
NodeJS WebServer x Apache Reverse Proxy
# enable proxy proxy_http
# copy to /etc/apache2/sites-available/
<VirtualHost *:80>
ServerName nodeserver.local
ServerAdmin webmaster@local
DocumentRoot /home/nodejs/apps/myapp
ErrorLog ${APACHE_LOG_DIR}/nodeserver-error.log
CustomLog ${APACHE_LOG_DIR}/nodeserver-access.log combined
@apampolino
apampolino / gitreader.php
Last active August 27, 2018 13:44
Download information from GitHub using basic authentication
<?php
// https:/api.github.com/user
$url = 'https://api.github.com/users/username/gists';
$headers = ['Authorization: Basic ' . base64_encode('username:password')];
// Get cURL resource
$ch = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($ch, array(
@apampolino
apampolino / provision-debian-apache.sh
Last active January 16, 2019 11:24
vagrant provision file for apache
echo '>>ADDING GOOGLE NAMESERVER'
echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
# apt -y update && apt -y upgrade
apt update
#https://github.com/chef/bento/issues/661#issuecomment-248136601
apt DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt install git screen memcached tcpdump tshark build-essentials unzip
@apampolino
apampolino / Dockerfile
Created June 1, 2018 16:37
Centos-nginx-php
FROM centos/systemd
MAINTAINER "apampolino" <pampolino.aaron@gmail.com>
ENV container docker
# google nameserver
RUN echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
# updates
echo '>>ADDING GOOGLE NAMESERVER'
echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
yum -y update
yum -y install wget git screen
echo '>>EPEL'
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm