Skip to content

Instantly share code, notes, and snippets.

View mnishihan's full-sized avatar

M N Islam Shihan mnishihan

  • Dhaka, Bangladesh
View GitHub Profile
@mnishihan
mnishihan / HUAWEI_E3531.sh
Created February 4, 2019 17:19 — forked from elacheche/HUAWEI_E3531.sh
Little script to enable HUAWEI E3531 on Ubuntu
sudo apt-get update && sudo apt-get install usb-modeswitch && v=$(lsusb | grep "Huawei" | awk '{ print $6 }' | awk -F: '{ print $1 }'); p=$(lsusb | grep "Huawei" | awk '{ print $6 }' | awk -F: '{ print $2 }'); sudo usb_modeswitch -v $v -p $p -M '55534243123456780000000000000011062000000100000000000000000000'
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @license Unlicensed
* @version 1.0
*/
class Excel {
private $col;
<?php
namespace {
die('Only to be used as an helper for your IDE');
}
namespace {
class App extends Illuminate\Support\Facades\App{
/**
* @var \Illuminate\Foundation\Application $root
*/
App.module("FooModule.Bar", {
startWithApp: false,
define: function() {
// Code of submodule
}
});
@mnishihan
mnishihan / awesome-php.md
Last active December 11, 2015 10:38 — forked from ziadoz/awesome-php.md

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).

#!/usr/bin/php
<?php
error_reporting(E_ALL);
if (count($argv) <= 1) {
print("usage createMockup src_dir dst_dir images_dir\n");
print("\tsrc_dir : dir where all bmml file are\n");
print("\tdst_dir : dir where write all html files\n");
print("\timages_dir : dir where all export mockup png are (will be copied to the \$dst_dir/images directory)\n");
exit(1);
}
@mnishihan
mnishihan / gist:3955873
Created October 25, 2012 22:28
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@mnishihan
mnishihan / errors.php
Created October 25, 2012 22:27
PHP: Display Errors
error_reporting(E_ALL);
ini_set('display_errors', '1');
@mnishihan
mnishihan / gist:3955864
Created October 25, 2012 22:27
JavaScript: Sexy PubSub
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind.
// Hat tip Paul Irish
var o = $( {} );
$.subscribe = o.on.bind(o);
$.unsubscribe = o.off.bind(o);
$.publish = o.trigger.bind(o);