Skip to content

Instantly share code, notes, and snippets.

View ajaxray's full-sized avatar
🪁
Exploring

Anis uddin Ahmad ajaxray

🪁
Exploring
View GitHub Profile
@ajaxray
ajaxray / 1_DialogRegion.js
Last active August 29, 2015 14:01
My version of Dialog/Modal/Popup region for Backbone.Marionette using Bootstrap modal
define([
'app',
'marionette'
], function(app, Marionette){
return Marionette.Region.extend({
onShow: function(view){
this.listenTo(view, "dialog:close", this.closeDialog);
var self = this;
@ajaxray
ajaxray / gist:70d869165fee67059eac
Last active August 29, 2015 14:03
সারা বিশ্বে কি একই দিনে ছিয়াম ও ঈদ হবে? (It's not a fatwa. Just my personal collection of references.)

সারা বিশ্বে কি একই দিনে ছিয়াম ও ঈদ হবে?

মতামত ১ঃ না প্রত্যেক শহরের লোকেরা তাদের নিজেদের চাঁদ দেখার উপর নির্ভর করবে

রাইব (রাঃ) বর্ণিত আছারে এসেছে যে, তিনি সিরিয়ায় রামাযানের ছিয়াম রেখে মাস শেষে মদীনায় ফিরে এখানকার ছিয়ামের সাথে এক দিন কমবেশ দেখতে পান। এ বিষয়ে ইবনু আববাস (রাঃ)-কে জিজ্ঞেস করা হ’লে তিনি বলেন যে, সিরিয়ার আমীর মু‘আবিয়া (রাঃ)-এর গৃহীত ছিয়ামের তারিখ মদীনায় প্রযোজ্য নয়। কেননা ওখানে তোমরা শুক্রবার সন্ধ্যায় চাঁদ দেখেছ। অতএব আমরা ছিয়াম চালিয়ে যাব, যতক্ষণ না ঈদের চাঁদ দেখতে পাব’।
অন্য বর্ণনায় এসেছে, আমরা ৩০ দিন পূর্ণ করব। তাঁকে বলা হ’ল: মু‘আবিয়ার চাঁদ দেখা ও ছিয়াম রাখা কি আপনার জন্য যথেষ্ট নয়? তিনি বললেন, না। এভাবেই রাসূলুল্লাহ (ছাঃ) আমাদেরকে নির্দেশ দান করেছেন। [1] ইমাম নববী বলেন, এ হাদীছ স্পষ্টভাবে প্রমাণ করে যে, এক শহরের চন্দ্র দর্শন অন্য শহরে প্রযোজ্য নয় অধিক দূরত্বের কারণে। [2]
[1]. তিরমিযী হা/৫৫৯; আবুদাঊদ হা/২০৪৪।
[2]. মির‘আত ৬/৪২৮ হা/১৯৮৯-এর ব্যাখ্যা।

@ajaxray
ajaxray / marionette_resource.md
Created June 28, 2014 07:34
Some MarionetteJS resources to make your app beautiful!

Temporarily switch to a different commit

If you want to temporarily go back to it, fool around, then come back to where you are, all you have to do is check out the desired commit:

# This will detach your HEAD, i.e. leave you with no branch checked out:
git checkout 0d1d7fc32

or if you want to make commits while you're there, go ahead and make a new branch while you're at it:

function asanaRequest($methodPath, $httpMethod = 'GET', $body = null)
{
$apiKey = 'ASANA_API_KEY_HERE'; /// Get it from http://app.asana.com/-/account_api
$url = "https://app.asana.com/api/1.0/$methodPath";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;
curl_setopt($ch, CURLOPT_USERPWD, $apiKey);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$fileName = 'Billing-Summary.csv';
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Description: File Transfer');
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename={$fileName}");
header("Expires: 0");
header("Pragma: public");
$fh = @fopen( 'php://output', 'w' );
@ajaxray
ajaxray / FormTestController.php
Created June 18, 2015 10:03
Sample Code snippets for my blog post "Symfony2 Forms with Twitter Bootstrap : Rendering a help block" http://wp.me/p2nCeQ-6u
/**
* @Route("/test/form/help", name="test_form_help")
*/
public function sampleFormAction()
{
$form = $this->createFormBuilder()
->add('task', 'text')
->add('dueDate', 'date')
->getForm();
@ajaxray
ajaxray / gist:52251bce4a7e82ac5e36
Last active August 29, 2015 14:25
Copy-Peste steps to Up and running behat with Symfony2

Up and running with behat with Symfony2

This is for someone who is good at Symfony2 and have the basic idea about behat. So not explaining things much. Just follow the steps and your Symfony2 project should be ready for testing (with running example bonus)!

  1. Add dependencies
sudo composer require --dev --prefer-dist "behat/behat:^3.0" "behat/symfony2-extension:~2.0" "behat/mink:~1.5" "behat/mink-extension:~2.0" "behat/mink-selenium2-driver" "behat/mink-browserkit-driver:~1.1"
@ajaxray
ajaxray / base.php
Created January 20, 2012 11:16
My Base model for Kohana PHP Framework
<?php defined('SYSPATH') or die('No direct script access.');
/**
* The C(reate) R(ead) U(pdate) D(elete) Model + more.
*
* @package preston
* @author Dave Widmer
* @author Anis uddin Ahmad <anisniit@gmail.com>
*/
class Model_Base extends Kohana_Model
{
@ajaxray
ajaxray / script.js
Created May 15, 2012 10:57
Suppressing/Disable/Hide JavaScript Errors and logging them
window.onerror = function myErrorFunction(message, url, linenumber) {
if(console != undefined){
console.log('Error: '+ message + ' Of: ' + url + ' At: line: ' + linenumber)
}
// I want to keep silent
return true;
}