Skip to content

Instantly share code, notes, and snippets.

View yajra's full-sized avatar

Arjay Angeles yajra

View GitHub Profile
@yajra
yajra / osx-for-hackers.sh
Created December 15, 2016 09:04 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@yajra
yajra / macosx-install-php-oracle-oci8.md
Created June 2, 2016 02:59 — forked from gido/macosx-install-php-oracle-oci8.md
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.8 - homebrew environnement

Installation

This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).

PHP 5.4 installed with Homebrew.

Update: I wrote a blog post about this.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

@yajra
yajra / elasticsearch-on-homestead.txt
Created March 14, 2016 08:14 — forked from lukaswhite/elasticsearch-on-homestead.txt
Installing Elasticsearch on Laravel Homestead
# Install Java
sudo apt-get install openjdk-7-jre-headless -y
# Download & install the Public Signing Key
wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
# Add the following to /etc/apt/sources.list
deb http://packages.elasticsearch.org/elasticsearch/1.3/debian stable main
# Update Aptitude
@yajra
yajra / PHPExcel_Basics.md
Created January 20, 2016 01:52 — forked from r-sal/PHPExcel_Basics.md
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

@yajra
yajra / dataTables.fnFilterOnReturn.js
Created November 26, 2015 06:39
DataTables fnFilterOnReturn plugin
jQuery.fn.dataTableExt.oApi.fnFilterOnReturn = function (oSettings) {
var _that = this;
this.each(function (i) {
$.fn.dataTableExt.iApiIndex = i;
var $this = this;
var anControl = $('input', _that.fnSettings().aanFeatures.f);
anControl
.unbind('keyup search input')
.bind('keypress', function (e) {
@yajra
yajra / ajax-datatables-expired-session.js
Last active June 30, 2022 20:34
Laravel 5.x solution to redirect AJAX expired session to login page and disable DataTables error prompt
/**
* Requirements:
* - jQuery (http://jquery.com/)
* - DataTables (http://datatables.net/)
* - BootboxJS (http://bootboxjs.com/)
* ---------------------------------------------------------------------------
* Credits to https://gist.github.com/flackend/9517696
* ---------------------------------------------------------------------------
* This monitors all AJAX calls that have an error response. If a user's
* session has expired, then the system will return a 401 status,