Skip to content

Instantly share code, notes, and snippets.

@aabidos
aabidos / install_canon_mp230.sh
Created November 8, 2014 14:36
Install CANON PIXMA MP230 linux scanner
#!/bin/sh
cd /temp
//Download libtiff4 - http://packages.ubuntu.com/saucy/libtiff4
wget http://mirrors.kernel.org/ubuntu/pool/universe/t/tiff3/libtiff4_3.9.7-2ubuntu1_amd64.deb
sudo dpkg -i libtiff4_3.9.7-2ubuntu1_amd64.deb
//Download canon's sotfwares - http://www.canon.fr/Support/Consumer_Products/products/Fax__Multifunctionals/InkJet/PIXMA_MP_series/PIXMA_MP230.aspx?type=download&language=EN&os=Linux
@aabidos
aabidos / pivot_example.php
Created May 9, 2014 15:03
Laravel Custom Pivot Model definition example
<?php
//https://github.com/laravel/framework/issues/2093#issuecomment-39154456
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Database\Eloquent\Relations\Pivot;
class User extends Eloquent {
public function groups() {
return $this->belongsToMany('Group');
<?php
// we suppose that sellsyconnect, sellsytools and boot files are created..
/*******Code to create client*******/
//We configure parameters for new client
$create_client_request = array (
'method' => 'Client.create',
@aabidos
aabidos / ionic_dockerfile
Last active May 14, 2016 21:53
Ionic cordova android dockerfile
# Android development environment for ubuntu precise (12.04 LTS).
# version 0.0.1
# Start with ubuntu precise (LTS).
FROM ubuntu:12.04
MAINTAINER Aurel <lighta971@live.fr>
# Never ask for confirmations
ENV DEBIAN_FRONTEND noninteractive
@aabidos
aabidos / phpmyadmin_installation_for_mysqlnd.md
Last active May 2, 2016 10:19
Install phpmyadmin 3.4.10.1 for mysqlnd

Installation of Phpmyadmin 3.4.10.1 with mysqlnd for Debian based OS##

Assuming php5-mysqlnd is already installed.

1) Download phpmyadmin deb package:

 apt-get download phpmyadmin
#subdomain name
echo -n "Name of your subdomain ?"
read -e subdomain
if [[ $subdomain != "" ]]
then
mkdir ~/$subdomain
sudo touch /etc/apache2/sites-available/$subdomain
sudo echo "<Virtualhost *:80>" >> /etc/apache2/sites-available/$subdomain
sudo echo " ServerName $subdomain.username.kd.io" >> /etc/apache2/sites-available/$subdomain
@aabidos
aabidos / flashDetector.js
Created December 27, 2013 19:00
Detect Flash enable in browser
try {
if( new ActiveXObject('ShockwaveFlash.ShockwaveFlash') ) flash = true;
}catch(e){
if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) flash = true;
}
@aabidos
aabidos / pop.js
Last active January 1, 2016 09:19
Open popup every x hours
function _pop(url) {
var e = {};
e.width = e.width || screen.width;
e.height = e.height || screen.height;
var t = "width=" + e.width + "px,height=" + e.height + "px,top=" + (screen.height - e.height) / 2 + ",left=" + (screen.width - e.width) / 2 + ",resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no";
var n = window.open("about:blank", "_blank", t, false);
n.document.location.href = url;
}
@aabidos
aabidos / helpers.php
Created December 20, 2013 13:07
Laravel Menu active state helper Add to composer.json: "autoload": { "files": ["app/helpers.php"] } Then run "composer dump" #http://paste.laravel.com/1acS
// helper
function set_active($path, $active = 'active') {
return call_user_func_array('Request::is', (array)$path) ? $active : '';
}
// usage in view
<li class="{{ set_active(['admin/institutes*','admin/courses*']) }}">
@aabidos
aabidos / gist:8054510
Created December 20, 2013 13:02
Laravel bootstrap
#------------------Set tinker config for Boris (Laravel 4.1>=)
#Go to cli php.ini (php --ini)
#remove all disable_functions
#reload apache "servce apache2 reload"
#-----------------Install clockwork for debugging
# https://github.com/itsgoingd/clockwork