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
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
@torifat
torifat / gist:977825
Created May 18, 2011 01:25
Git Delete Tag
git tag new old
git tag -d old
git push origin :old
@torifat
torifat / sample1.js
Created June 17, 2011 19:23
Optional Parameter in JavaScript
function foo(optional) {
if (optional === undefined) optional = "default";
}
@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 (
@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",
@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 / 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 / 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 / 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 / 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;
},