Skip to content

Instantly share code, notes, and snippets.

View mohsin's full-sized avatar

Saifur Rahman Mohsin mohsin

View GitHub Profile
@mohsin
mohsin / gist:f69ee7c97737cae8b3b1
Last active August 29, 2015 14:18
OctoberCMS Backend Light Theme
.layout #layout-mainmenu.navbar {
background-color: #FFF;
border-bottom: 1px solid #DDD;
}
.layout #layout-mainmenu.navbar ul li {
text-align: center;
padding: 0 15px;
margin-right: 3px;
}
nav#layout-mainmenu.navbar ul li.power-off a, nav#layout-mainmenu.navbar ul li.preview a {
@mohsin
mohsin / Font Face mixin usage
Created April 13, 2015 22:22
Font Face mixin usage
//
// Font Face mixin usage (https://github.com/perry/sass-font-face)
// @include font-face($style-name, $file, $family, $category)
// $style-name being the name of the font e.g. Helvetica
// $file meaning the file name, without the file extensions
// $family being the folder inside the fonts folder where the font files are
// $category is serif or sans-serif or monospace etc. as a fall back in CSS
//
=font-face($style-name, $file, $family, $category: "", $weight: "", $style: "")
@mohsin
mohsin / Font Smoothing mixin
Created April 13, 2015 22:23
Font Smoothing mixin
//
// Font Smoothing mixin usage
// @include font-smoothing($value)
//
=font-smoothing($value: antialiased)
@if $value == antialiased
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
@else
@mohsin
mohsin / Sass version of PHP Implode
Created April 13, 2015 22:25
Sass version of PHP Implode
//
// Returns string after joining list elements with a glue string.
// Similar to PHP's implode function
//
@function implode($list, $glue: '', $is-nested: false)
$result: null
@for $i from 1 through length($list)
$e: nth($list, $i)
@mohsin
mohsin / Sass version of PHP explode
Created April 13, 2015 22:25
Sass version of PHP explode
//
// Returns list after splitting a string by a delimiter string.
// Similar to PHP's explode function
//
@function explode($string, $delimiter: "", $separator: "space")
@if type-of($string) != "string"
@warn "`explode` function expecting a string; #{type-of($string)} given."
@return null
@if type-of($delimiter) != "string"
@warn "`explode` function expecting a string; #{type-of($delimiter)} given."
function push() {
if [ -z "${1}" ]; then
echo "Usage: push <remote-name>"
return 1
fi;
GIT_DIR_="$(git rev-parse --git-dir)"
BRANCH="$(git rev-parse --symbolic --abbrev-ref $(git symbolic-ref HEAD))"
@mohsin
mohsin / numberToCurrency.php
Created October 8, 2015 20:37
Convert PHP number to Indian rupee format
public function numberToCurrency($num)
{
if(setlocale(LC_MONETARY, 'en_IN'))
return money_format('%.0n', $num);
else {
$explrestunits = "" ;
if(strlen($num)>3){
$lastthree = substr($num, strlen($num)-3, strlen($num));
$restunits = substr($num, 0, strlen($num)-3); // extracts the last three digits
$restunits = (strlen($restunits)%2 == 1)?"0".$restunits:$restunits; // explodes the remaining digits in 2's formats, adds a zero in the beginning to maintain the 2's grouping.
@mohsin
mohsin / README.md
Created November 26, 2015 15:38 — forked from Coeur/README.md
Write to NTFS on OSX Yosemite and El Capitan

Install osxfuse (3.x.x) from https://github.com/osxfuse/osxfuse/releases.

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update
@mohsin
mohsin / build.gradle
Created January 15, 2016 18:37 — forked from creativepsyco/build.gradle
Gist for creating Dex file for class files in Android Library
/**
* The Task Below uses the Dex Tool to create classes.dex file for the archive
* This dex file can be then be loaded at runtime to prevent the 64K Dalvik Method Limit
*/
import org.apache.tools.ant.taskdefs.condition.Os
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals(com.android.builder.BuilderConstants.DEBUG)) {
return; // Skip debug builds.
}
@mohsin
mohsin / HackFB.diff
Created January 15, 2016 18:59 — forked from creativepsyco/HackFB.diff
Facebook Android SDK 3.6.0 OAuth using embedded Web View
diff --git i/facebook-android-sdk-3.6.0/facebook/src/com/facebook/widget/WebDialog.java w/facebook-android-sdk-3.6.0/facebook/src/com/facebook/widget/WebDialog.java
index 70ac868..c2c9af0 100644
--- i/facebook-android-sdk-3.6.0/facebook/src/com/facebook/widget/WebDialog.java
+++ w/facebook-android-sdk-3.6.0/facebook/src/com/facebook/widget/WebDialog.java
@@ -17,6 +17,7 @@
package com.facebook.widget;
import android.annotation.SuppressLint;
+import android.app.AlertDialog;
import android.app.Dialog;