Skip to content

Instantly share code, notes, and snippets.

View arifmahmudrana's full-sized avatar

Arif Mahmud Rana arifmahmudrana

View GitHub Profile
@arifmahmudrana
arifmahmudrana / index.php
Created September 9, 2013 10:34
Create a file on the fly using php output buffering. Sometime we need to create file on the fly this serves the purpose.
<?php
/*
* @source http://stackoverflow.com/questions/15769732/write-to-php-output-buffer-and-then-download-csv-from-buffer
*/
$basic_info = fopen("php://output", 'w'); //Open output buffer to write
$content = file_get_contents(__FILE__); //Read the current file
fwrite($basic_info, $content); //Write to output buffer
fclose($basic_info); // Close the context
header("Content-disposition: attachment; filename=index.php");
@arifmahmudrana
arifmahmudrana / changepermission
Created September 11, 2013 07:06
In social engine some time we need to change permission of groups.
/*
*
* Put this into any test controller and test action
*
*/
$auth = Engine_Api::_()->authorization()->context;//Get Allow DB Table
foreach (Engine_Api::_()->getDbtable('groups', 'group')->fetchAll() as $group) ://Fetch All Groups
$auth->setAllowed($group, 'registered', 'comment');//This set disallow registered members to post to group
$auth->setAllowed($group, 'registered', 'photo');//This set disallow registered members to create any event
@arifmahmudrana
arifmahmudrana / Some important links
Created September 19, 2013 09:27
In this file I will list some important links that will be useful for developer
@arifmahmudrana
arifmahmudrana / mootools-with-animate-dot-css.html
Created December 17, 2014 17:22
How to animate HTML5 elements with animate.css and MooTools
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MooTools with animate.css</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.min.css" />
</head>
<body>
<span id="animationSandbox" style="display: block;"><h1 class="site__title mega">Animate.css</h1></span>
<div class="wrap">
@arifmahmudrana
arifmahmudrana / List.md
Last active August 29, 2015 14:13 — forked from msurguy/List.md

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@arifmahmudrana
arifmahmudrana / index.html
Created June 2, 2015 11:39
ngMessages Example
<!DOCTYPE html>
<html ng-app="app">
<head>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<style>
html, body {
position:relative;
background:url(focus.png);
}
<!DOCTYPE HTML>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<title>Dynamic Pagination w/ Filtering</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Kim Maida">
<!-- JS Libraries -->
@arifmahmudrana
arifmahmudrana / git-repo-create
Created August 29, 2015 09:19
Step By Step how to create a github repo and tag for release
git clone Repository
cd Directory
Then create branch from github
git fetch
git checkout dev
git status
git add --all
git commit -m 'initial commit'