Skip to content

Instantly share code, notes, and snippets.

View maxca's full-sized avatar
🏠
Working from home

samark chaisanguan maxca

🏠
Working from home
View GitHub Profile
/** main controller */
(function(){
var mainController = angular.module('mainController', ['moduleConfig','facebookFactory','serviceLocalStorage']);
mainController.controller('mainController', ['$scope', '$window', 'config','facebook','localStorage',
function($scope, $window ,config,facebook,localStorage) {
console.log(config);
facebook.checkConnect().then(function(status){
/** case already authen */
console.log(status);
/** config constant */
(function() {
var moduleConfig = angular.module('moduleConfig', []);
moduleConfig.constant('config', {
local: {
baseUrl: 'http://localhost',
getprofile: '/get-profile',
register: '/register',
removeProfile: '/remove-profile',
getall: 'get-all-profile',
/** facebook factory */
var facebookFactory = angular.module('facebookFactory', ['moduleConfig']);
facebookFactory.service('facebook', ['$window','facebookConfig', 'connect','getProfile',
function($window,facebookConfig,connect,getProfile) {
var init = function() {
$window.fbAsyncInit = function() {
FB.init({
appId: facebookConfig.appId,
status: facebookConfig.status,
/** service local storage */
(function() {
var serviceLocalStorage = angular.module('serviceLocalStorage', []);
serviceLocalStorage.service('localStorage', function() {
this.set = function(key, value) {
return localStorage.setItem(key, value);
};
this.get = function(key) {
return localStorage.getItem(key);
};
<?php
class servicePackageRepository implements servicePackageInterface
{
private $packageId;
private $lang;
private $serviceCall3rdRepository;
public function __construct(serviceCall3rdRepository $serviceCall3rdRepository, $package_id)
{
$this->serviceCall3rdRepository = $serviceCall3rdRepository;
<?php namespace App\Providers;
use App\Repositories\Storage\serviceCall3rdRepository;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
<?php namespace App\Http\Controllers\;
use App\Http\Controllers\FrontendController;
/** alias name servicePackageInterface as packge **/
use App\Repositories\Interfaces\servicePackageInterface as packge;
use App\Repositories\Storage\servicePackageRepository as packageRepository;
class PackageController extends FrontendController
{
private $packge;
<?php namespace App\Http\Controllers\;
use App\Http\Controllers\FrontendController;
/** alias name servicePackageInterface as packge **/
use App\Repositories\Interfaces\servicePackageInterface as packge;
use App\Repositories\Storage\servicePackageRepository as packageRepository;
class PackageController extends FrontendController
{
private $packge;
private $packageRepository;
/** typing hiting packageRepository **/
// Create directory bin.
sudo mkdir bin
// Compiled command with javac.
sudo javac -d bin Hw.java
Manifest-Version: 1.0
Created-By: Samark
Main-Class: Hw