Skip to content

Instantly share code, notes, and snippets.

View mohsin's full-sized avatar

Saifur Rahman Mohsin mohsin

View GitHub Profile
@mohsin
mohsin / business-offers.md
Created March 9, 2018 15:03
My business offers

I'm a freelance app developer and make really good money building apps for others. One of my long term goals is to hire more people and work together but not yet. Instead, I've put 2 other offers to my friends and only 1 out of the 20 people I offered, took up one and he makes money regularly. So, I'll put forward the same offers to you and if you think you can do this then we're on!

First offer (low income with less effort)

Get me projects (clients) for web and mobile development. Whatever money I make from the client you refer, I give 5% finder fee perpetually (that means that even if they come back after a project for more work, since you referred you get paid the finder fee every time money comes my way thro' that client). One of my good friends took this offer up and he makes a decent level of money every month from the clients that he referred to me. Lucky for him, the clients have kept coming back for more work so it's been stable income for him. It's like a

@mohsin
mohsin / OctoberCMS-Setup.md
Last active September 20, 2017 21:11
OctoberCMS Web Project Setup

Checklist available as Trello board as well. Copy board at https://trello.com/b/3jxpgyRE to use.

Setup OctoberCMS

  • Pull OctoberCMS
wget https://octobercms.com/download
unzip master
mv install-master/ Web
rm master
cd Web/
@mohsin
mohsin / totaltime.sh
Created August 2, 2017 18:01
Bash script to find the total duration of videos in a folder
ext=".mp4"
ffmpeg_location="/usr/local/Cellar/ffmpeg/3.1.2/bin/ffmpeg"
for file in *$ext
do
duration=$("$ffmpeg_location" -i "${file}" 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,//)
hours=10#$(echo "$duration" | cut -d":" -f1)
minutes=10#$(echo "$duration" | cut -d":" -f2)
seconds=10#$(echo "$duration" | cut -d":" -f3 | cut -d"." -f1)
millis=10#$(echo "$duration" | cut -d":" -f3 | cut -d"." -f2)
((totalMillis=millis+seconds*1000+minutes*60000+hours*3600000))
@mohsin
mohsin / KEYSTORE.md
Last active January 4, 2021 22:05
Using Keystore properties in Android Projects
  1. Add to project-level build.gradle:
allprojects {
    ...
    afterEvaluate { project ->
        def propsFile = rootProject.file('keystore.properties')
        def configName = 'release'

        if (propsFile.exists() && project.hasProperty("android") && project.android.signingConfigs.hasProperty(configName)) {
@mohsin
mohsin / gist:fd4f0880072adf976f8998cbbde61bde
Created May 26, 2017 09:35
Hotel Empire Restaurant List. When I was at my friend’s place I had to scrape it off to figure out the closest area where I wanted food to be delivered. The app has no GPS detection feature, what a piece of crap.
<option class="ajax-area-search-li form-control" value="1" outlet_id="8" area_name="ASHOK NAGAR" area_id="1">AS
HOK NAGAR</option>
<option class="ajax-area-search-li form-control" value="2" outlet_id="8" area_name="AUSTIN TOWN" area_id="2">AU
STIN TOWN</option>
<option class="ajax-area-search-li form-control" value="3" outlet_id="8" area_name="BASAPPA ROAD" area_id="3">BA
SAPPA ROAD</option>
<option class="ajax-area-search-li form-control" value="5" outlet_id="8" area_name="BRIGADE ROAD" area_id="5">BR
@mohsin
mohsin / InrSimplifier.java
Created May 10, 2017 12:26
Java Class to convert a number to a short-format indian currency representation
import java.util.*;
import java.util.Map.*;
import java.text.DecimalFormat;
/**
* Makes a longer number shorter like cr., lac, etc.
* Output: 500, 4k, 30k, 99k, 2lac, 9.9lac, 40lac, 99lac, 1.9Cr., 20Cr., 100Cr., 214Cr
* Limitation: Works from zero to the longest int or as Indians call, the Mallya limit.
*/
@mohsin
mohsin / Installs.php
Created December 30, 2016 09:11
The Controller
<?php namespace Mohsin\Mobile\Controllers;
use Cookie;
use BackendMenu;
use Backend\Classes\Controller;
use Mohsin\Mobile\Models\Variant;
/**
* Installs Back-end Controller
*/
@mohsin
mohsin / _list_toolbar.htm
Created December 30, 2016 09:09
The toolbar partial
<div class="control-toolbar">
<?php if (count($variants) == 0): ?>
<div class="toolbar-item callout fade in callout-danger">
<div class="form-control content" style="padding: 10px 20px 10px;">
<p>You must create at least one app with one variant to see values in this section.</p>
</div>
</div>
<?php else: ?>
<div class="toolbar-item toolbar-primary">
<div id="dropdown-variant" data-control="toolbar">
@mohsin
mohsin / _dropdown.htm
Created December 30, 2016 09:08
The Dropdown partial file
<div class="dropdown dropdown-fixed">
<button
id="parentDropdown"
type="button"
class="btn btn-default oc-icon-mobile"
data-toggle="dropdown">
<?php echo $variants[$this -> variant_id] ?> <?php if (count($variants) > 1): ?><span class="caret"><?php endif ?>
</button>
<?php if (count($variants) > 1): ?>
<ul class="dropdown-menu" role="menu" data-dropdown-title="Select variant">
@mohsin
mohsin / steps.txt
Last active July 26, 2017 06:57
How to Setup OctoberCMS with Heroku
// Install heroku toolbelt
Moz at Saifurs-MacBook-Pro in ~/Desktop
$ brew install heroku
==> Downloading http://assets.heroku.com.s3.amazonaws.com/heroku-client/heroku-c
######################################################################## 100.0%
/usr/local/Cellar/heroku-toolbelt/3.21.4: 449 files, 3.5M, built in 17 seconds
// Create an app