Skip to content

Instantly share code, notes, and snippets.

View ChaosPower's full-sized avatar
💭
I may be slow to respond.

Randy Glenn Aguirre ChaosPower

💭
I may be slow to respond.
  • Philippines
View GitHub Profile
@ChaosPower
ChaosPower / MatrixGen.php
Created February 13, 2014 09:51
PHP: Vertical Matrix Example
<?php
/**
*
* Utility class for matrix vertical data
*
* @author ChaosPower
* @license WTFPL
*
*/
@ChaosPower
ChaosPower / variableAsFunction.php
Created July 24, 2014 04:06
PHP: Variable as function
<?php
function call($f)
{
return $f();
}
function sample()
{
return 'sample called';
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/c3/0.3.0/c3.min.css">
</head>
<body>
<div id="d-chart"></div>
@ChaosPower
ChaosPower / SailsJS Sails-OracleDB Installation
Last active August 29, 2015 14:11
SAILSJS:: SAILS-ORACLE: Ubuntu Server 14.10 LTS
Complete Requirements
From https://github.com/joeferner/node-oracle
Run environment checking
"source pre_install_check.sh"
When "everythings looks dandy" appears
@ChaosPower
ChaosPower / ItemListActivity.java
Last active January 2, 2016 02:59
Replace Fragment
Bundle arguments = new Bundle();
arguments.putString(DashboardDetailFragment.ARG_ITEM_ID, id);
DashboardDetailFragment dDf = new DashboardDetailFragment();
dDf.setArguments(arguments);
getSupportFragmentManager().beginTransaction()
.setCustomAnimations(R.anim.abc_fade_in,R.anim.abc_fade_out)
.replace(R.id.item_detail_container, dDf)
.commit();
@ChaosPower
ChaosPower / makeDirSample
Created November 9, 2016 02:57
Linux Commands | mkdir - multiple
mkdir -p {blah1,blah2,blah3}/{fish,cheese}
@ChaosPower
ChaosPower / webpack.mix.js
Created May 24, 2017 17:05
Laravel 5.4: Webpack: Custom SSL Certificate and Key for Browsersync Laravel Mix
const { mix } = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
@ChaosPower
ChaosPower / axios_cancel.js
Created September 25, 2019 09:09
Javascript: Cancel Duplicate Axios calls.
let pending = []; // declares an array for storing the cancellation function and Axios identifier for each request
let cancelToken = axios.CancelToken;
let removePending = (config) => {
let xUrl = config.url.split('/');
let yUrl = '';
if(xUrl.length > 3) {
xUrl.pop(); // silently remove last Index;
yUrl = xUrl.join('/');
<?php
$options = getopt('f:', ['file:']);
if ($options['file'] != '') {
require_once $options['file'];
$oracle = new oracle();
@ChaosPower
ChaosPower / Eval.php
Last active February 26, 2020 01:24
PHP CLI Script
<?php
$options = getopt('f:', ['file:']);
if ($options['file'] != '') {
require_once $options['file'];
$oracle = new oracle(); // Files with same class name instance.
if (!property_exists($oracle, 'fields')) {