Skip to content

Instantly share code, notes, and snippets.

View azraai's full-sized avatar

Ariff Azraai azraai

View GitHub Profile
@azraai
azraai / item.rb
Created May 13, 2013 08:36
Is this association possbile?
class Item < ActiveRecord::Base
belongs_to :user
belongs_to :messenger, :class_name => 'User'
end
@azraai
azraai / Gemfile
Created November 30, 2013 14:28
Transititions gem errors
source 'https://rubygems.org'
gem 'rails', '3.2.15'
gem 'mysql2'
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'rails-settings-cached'
gem 'inherited_resources'
gem 'has_scope'
gem 'transitions', :require => ["transitions", "active_model/transitions"]
gem 'devise'
@azraai
azraai / CoreServiceProvider.php
Created January 17, 2015 15:28
src/CoreServiceProvider.php
<?php namespace Mux\Core;
use Orchestra\Support\Providers\ServiceProvider;
class CoreServiceProvider extends ServiceProvider
{
/**
* Register service provider.
*
* @return void
@azraai
azraai / Ebpg.php
Created July 6, 2015 07:23
Ebpg.php
<?php
class Ebpg {
public $hash_key;
public $merchant_id;
public $prefix;
public $order_number;
public $amount;
public $signature;
public $prefix_number;
@azraai
azraai / Fpx.php
Created July 6, 2015 07:24
Fpx.php
<?php
class Fpx {
public $merchant_id;
public $prefix;
public $order_number;
public $user_email;
public $description;
public $amount;
public $exchange_id;
@azraai
azraai / EloquentFinite.php
Created August 20, 2015 15:09
Implementing Finite in Eloquent
<?php
use Finite\StateMachine\StateMachine;
use Finite\State\State;
use Finite\State\StateInterface;
trait EloquentFinite
{
protected $states = [];
protected $transitions = [];
<?php
require '../vendor/autoload.php';
// Database information
$settings = array(
'driver' => 'mysql',
'host' => '127.0.0.1',
'database' => '',
'username' => '',
'password' => '',
@azraai
azraai / vue-grid.js
Created February 11, 2016 06:25
Vue Grid
var dataGridComponent = Vue.extend({
template: [
'<table id="{{ id }}" class="{{ class }}">',
'<thead>',
'<tr>',
'<th v-for="column in columns" v-on:click="sortBy(column)">',
'{{ renderHeaderCell(column) }}',
'</th>',
'<th v-if="actions | presentObject">&nbsp;</th>',
'</tr>',
aambp:~ aa$ ping -c 4 128.199.115.108
PING 128.199.115.108 (128.199.115.108): 56 data bytes
Request timeout for icmp_seq 0
64 bytes from 128.199.115.108: icmp_seq=1 ttl=57 time=73.497 ms
64 bytes from 128.199.115.108: icmp_seq=2 ttl=57 time=64.323 ms
--- 128.199.115.108 ping statistics ---
4 packets transmitted, 2 packets received, 50.0% packet loss
round-trip min/avg/max/stddev = 64.323/68.910/73.497/4.587 ms
aambp:~ aa$ ping -c 4 128.199.149.72
<?xml version="1.0" encoding="UTF-8"?>
<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>administrator</cas:user>
<cas:id>3</cas:id>
<cas:last_name>Super Admin</cas:last_name>
<cas:email>[email protected]</cas:email>
<cas:username>administrator</cas:username>
<cas:inceif_type>staff</cas:inceif_type>
<cas:inceif_status>active</cas:inceif_status>