Skip to content

Instantly share code, notes, and snippets.

View bajramemini's full-sized avatar

Bajram Emini bajramemini

View GitHub Profile
@bajramemini
bajramemini / phpversion.sh
Last active August 27, 2017 16:13 — forked from vjandrea/phpversion.sh
Change php cli version in plesk
#!/bin/sh
printf "Switching php to version 7.0 with symlinks.\n"
printf "Press any key to continue...\n"
read CONTINUE
printf "Creating backups..."
# Backup original binaries
@bajramemini
bajramemini / manager.md
Last active June 15, 2016 00:24
Manager.md

Manager

The media manager makes integrating media with your extension a breeze. It allows you to attach media to your entities. The following example is going to explain how to use the manager for an Employee.

Model setup

The model must use Platform\Media\Support\MediaTrait and implement Cartalyst\Support\Contracts\NamespacedEntityInterface

Example
[{"name":"users","color":"Red","position":{"x":100,"y":100},"increment":true,"timestamp":true,"softdelete":true,"column":[{"name":"Test","type":"string","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c23","order":0}],"relation":[],"seeding":[]},{"name":"invoices","color":"Green","position":{"x":419,"y":97},"increment":true,"timestamp":true,"softdelete":true,"column":[],"relation":[],"seeding":[]}]
@bajramemini
bajramemini / AuthenticateController.php
Last active September 9, 2015 23:07 — forked from iolson/AuthenticateController.php
SentinelAuthAdapter for using Tymon\JWTAuth with Cartalyst\Sentinel
<?php namespace App\Http\Controllers\Api\V1;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use Illuminate\Http\Request;
use Tymon\JWTAuth\Facades\JWTAuth;
use Tymon\JWTAuth\Exceptions\JWTException;
class AuthenticateController extends Controller
{
#!/bin/bash
# Make sure you are up to date
yum -y update && yum -y install wget
# Install EPEL repository
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Get us a clean working directory
mkdir /php
<?php
use Illuminate\Support\Contracts\ArrayableInterface;
use Illuminate\Support\Contracts\JsonableInterface;
class Excel implements ArrayableInterface, JsonableInterface{
protected $objPHPExcel;
public function __construct($file){
if($file instanceof \SplFileInfo){
$filename = $file->getRealPath();

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@bajramemini
bajramemini / gist:4672591
Created January 30, 2013 11:21
HTML: Starting Template
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title></title>
</head>
<body>
<script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
</body>