Skip to content

Instantly share code, notes, and snippets.

View Abdullamhd's full-sized avatar

Abdullah Mohammed Abdullamhd

View GitHub Profile
import imp
import random
import urllib.request
import threading
def generate_credit_card_number():
cc_number = [0] * 15
for i in range(15):
cc_number[i] = random.randint(0, 9)
@Abdullamhd
Abdullamhd / vscode_shortcuts.md
Created October 16, 2021 06:55 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@Abdullamhd
Abdullamhd / pi_chart.dart
Created May 2, 2020 11:07
this is pure pi chart in dart programming language
// chart data
List expenses = [
{"name":"Groceries","amount":500.0},
{"name":"Online Shopping","amount":100.0},
{"name":"Eating out","amount":80.0},
@Abdullamhd
Abdullamhd / main.dart
Created March 1, 2020 07:40
isolate example in dart programming language
/// dart complete isolate example
import 'dart:io';
import 'dart:async';
import 'dart:isolate';
Isolate isolate;
void start() async {
ReceivePort receivePort= ReceivePort(); //port for this main isolate to receive messages.
@Abdullamhd
Abdullamhd / push_notification.java
Last active February 20, 2020 09:12
sending push notification from java
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.firebase.messaging.FirebaseMessagingException;
import com.google.firebase.messaging.Message;
import com.google.firebase.messaging.Notification;
import org.junit.Before;
import org.junit.Test;
@Abdullamhd
Abdullamhd / write_stream.js
Created September 30, 2019 19:53
write income files as stream in node js and express
const express = require('express')
const multer = require('multer')
const upload = multer()
const app = express()
var fs = require('fs');
app.post('/',upload.array('file',4),(req,res)=>{
req.files.forEach((file)=>{
console.log(file)
@Abdullamhd
Abdullamhd / multiple_file_upload.dart
Last active September 30, 2019 19:04
multiple file upload using dart programming language
import 'package:http/http.dart' as http;
import 'dart:io';
import 'package:http_parser/http_parser.dart';
import 'package:mime/mime.dart';
void main() async {
var uri = Uri.parse('http://localhost:3000/');
var request = http.MultipartRequest('POST', uri ,);
var path = File('b1.jpeg').path ;
@Abdullamhd
Abdullamhd / upload.js
Created September 30, 2019 10:21
upload file into node js express
app.post('/', async (req,res)=>{
try {
const result = await app.dbUtil.db.collection('users').insertOne(req.body)
res.json(result)
} catch(error){
@Abdullamhd
Abdullamhd / http_post.dart
Last active September 30, 2019 10:23
post json into server from dart
import 'package:http/http.dart' as http;
import 'dart:convert';
void main() async {
var url = 'http://localhost:3000/';
var body = jsonEncode({
'name' : 'Abood',
'Color' : 'blue'
});
@Abdullamhd
Abdullamhd / cercomfrance_coord.dart
Last active September 30, 2019 10:23
find circomference points from center coordinate
import 'dart:math';
/// generate coordnates for cercomfrance
void main(){
var radius = 100.0 ;
var centerLat = 25.756037 ;
var centerLon = 55.969354 ;