Skip to content

Instantly share code, notes, and snippets.

Mohamad Atie MohamadAtieh

Block or report user

Report or block MohamadAtieh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<!doctype HTML>
<meta charset = 'utf-8'>
<link rel='stylesheet' href='//'>
<script src='//' type='text/javascript'></script>
<script src='//' type='text/javascript'></script>
<script src='//' type='text/javascript'></script>
<script src='//' type='text/javascript'></script>
public class MainClass {
public static void main(String args[]){
String sampleData = "1-2,2-3,3-4,9-0,0-9,2-4,5-6,9-0,8-9,9-8,1-9,1-3,1-10,10-13,11-12,12-15,15-19,19-22,20-22,21-20,18-20,1-20,1-19,1-9,20-21,21-22,22-0,1-22,9-20,9-23,19-8,2-18,7-21,2-21,21-3";
// String sampleData2 = "3-4,4-9,8-0,2-3,5-6,2-9,5-9,7-3,4-8,5-6,0-2,6-1,6-1,0-2,5-6,4-8,7-3,5-9,2-9,5-6,2-3,8-0,4-9,3-4";
// String sampleData3 = "3-4,4-9,8-0,2-3,5-6,2-9,5-9,7-3,4-8,5-6,0-2,6-1,3-4,4-9,8-0,2-3,5-6,0-2,5-9,7-3,4-8,5-6,2-9,6-1,3-4,4-9,8-0,2-3,5-6,2-9,5-9,7-3,4-8,5-6,0-2,6-1";
ProblemMatrix matrix = new ProblemMatrix(new boolean[50][50]);
MohamadAtieh /
Created Feb 22, 2016 — forked from burgalon/
Implementing OAuth2 with AccountManager, Retrofit and Dagger
public class AccountAuthenticator extends AbstractAccountAuthenticator {
private final Context context;
@Inject @ClientId String clientId;
@Inject @ClientSecret String clientSecret;
@Inject ApiService apiService;
public AccountAuthenticator(Context context) {
View controller.js
const LinkSchema = require('../models/link');
const isUrl = require('../node_modules/validator/lib/isURL');
const alphabets = '23456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ-_',
base = alphabets.length;
* Saves the link to the database and returns a shortened one
* @param req URL to save and shorten
View link.js
View counter.js
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const CounterSchema = new Schema({
_id: { type: String, required: true },
count: { type: Number, default: 0 }
}, {
timestamps: true,
collection: 'counters'
View index.js
const express = require('express');
const router = express.Router();
const mainController = require('../controllers');
const pj = require('../package.json');
/* GET home page. */
router.get('/', (req, res) => {
res.status(200).json({ name:, version: pj.version});
MohamadAtieh /
Created Sep 20, 2015
Shared preference manager
import android.content.Context;
import android.content.SharedPreferences;
* Created by matie on 20/09/15.
* Singleton manager
You can’t perform that action at this time.