Skip to content

Instantly share code, notes, and snippets.

View torifat's full-sized avatar
🇸🇩
Why do we even have this here?

Rifat Nabi torifat

🇸🇩
Why do we even have this here?
View GitHub Profile
@torifat
torifat / php-switch
Created July 30, 2012 18:11
a php switching utillity for homebrew
#!/bin/bash
# php switch for homebrew
# $ brew tap josegonzalez/php && brew install php53 --with-mysql && brew install php54 --with-mysql
# Might as well ask for password up-front, right?
sudo -v
VERSION_FILE="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/php-switch.version"
@torifat
torifat / extract
Created June 10, 2012 10:58
extract
#!/usr/bin/env bash
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.jar) jar xvf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
@torifat
torifat / dabblet.css
Created December 31, 2011 01:12
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
@torifat
torifat / Detect Browser & OS.js
Created November 18, 2011 20:36
Detect Browser & OS
var e = {
ie: function() {
return e._populate() || this._ie;
},
ie64: function() {
return e.ie() && this._win64;
},
firefox: function() {
return e._populate() || this._firefox;
},
@torifat
torifat / callback.html
Last active June 19, 2020 18:02
Enable Avro Phonetic in all textboxes & textareas with a callback function
<script src="path/to/avro-x.x.x.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function(){
$('textarea, input[type=text]').avro({'bangla':true},
function(isBangla){
alert('Bangla enabled = ' + isBangla);
}
);
});
</script>
@torifat
torifat / params.html
Last active September 27, 2015 23:58
Enable Avro Phonetic in all textboxes & textareas with default mode set to English
<script src="path/to/avro-x.x.x.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function(){
$('textarea, input[type=text]').avro({'bangla':false});
});
</script>
@torifat
torifat / default.html
Last active September 27, 2015 23:58
Enable Avro Phonetic in all textboxes & textareas
<script src="path/to/avro-x.x.x.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function(){
$('textarea, input[type=text]').avro();
});
</script>
@torifat
torifat / .bashrc
Created September 30, 2011 18:21
My Bashrc
## If not running interactively, don't do anything
[ -z "$PS1" ] && return
export EDITOR='mate'
export GIT_EDITOR='mate -wl1'
## History control
# Control how bash stores command history
# flags: ignorespace, ignoredups, ignoreboth
@torifat
torifat / deploy.rb
Created August 11, 2011 18:44 — forked from josegonzalez/deploy.rb
Capistrano Deploy Script for CakePHP applications using GIT (Update the $config hash))
$config = {
"application" => "DOMAIN.TLD",
"repository" => "git@GITHOST:USERNAME/REPOSITORYNAME.git",
"remoteusername" => "REMOTEUSERNAME",
"cake_folder" => "/PATH/TO/CAKE",
"cake_version" => "cakephp1.3",
"plugin_dir" => "plugins",
"servers" => {
"prod" => {
"server" => "APPLICATION.TLD",
@ECHO OFF
SET TPATH = "%~d0%~p0"
FOR %%A IN (a b c d e f g h i j) DO (
mkdir "%TPATH%%%A"
FOR %%B IN (a b c d e f g h i j) DO (
mkdir "%TPATH%%%A\%%B"
FOR %%C IN (a b c d e f g h i j) DO (
mkdir "%TPATH%%%A\%%B\%%C"
FOR %%D IN (a b c d e f g h i j) DO (