Instantly share code, notes, and snippets.

🎯
Focusing

# Ahmed Hosny code2be

🎯
Focusing
• Egypt
• 20:41 (UTC +03:00)
Created September 11, 2022 15:28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 # Formula Calculator formula = input("Enter the formula") # 35 + 12 # 47 x = formula.find("+") a = float(formula[:x]) b = float(formula[x+1:])
Created September 8, 2022 11:07
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 x = float(input("Enter first number")) y = float(input("Enter second number")) o = input("Enter operator") # + - / * % if o == "+": print(x + y) elif o == "-": print(x - y) elif o == "*":
Created September 8, 2022 11:06
simple_calc.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 x = float(input("Enter first number")) y = float(input("Enter second number")) o = input("Enter operator") # + - / * % if o == "+": print(x + y) elif o == "-": print(x - y) elif o == "*":
Created March 3, 2020 13:51
integerToEnglishWords pretty code by psr@CodeSignal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 // Simple JS code to convert a number into English Words. // Copied from CodeSignal Solutions, Coded by psr < https://app.codesignal.com/profile/psr > a = ` One Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve Thirteen Fourteen`.split` ` b = ` Twen Thir For Fif Six Seven Eigh Nine`.split` ` w = ` Thousand Million Billion`.split` ` f = integerToEnglishWords = ( n, k = 0,
Created December 31, 2019 16:28
JS Regexp for mobile numbers in Egypt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 var validate_egypt_mobile = (mobileStr) => { return /^(010|012|011|015)[0-9]{8}\$/.test(mobileStr); }
Last active October 25, 2016 12:04 — forked from prime31/gist:5675017
Simple PHP code to send FCM Push Notification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

Created January 25, 2016 07:36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 D/AsyncHttpClient: Headers were overwritten! (Accept | application/json) overwrites (Accept | application/json) W/DefaultRequestDirector: Authentication error: Unable to respond to any of these challenges: {} V/AsyncHttpResponseHandler: Progress 993 from 993 (100%) W/remoting.RestAdapter: HTTP request (string) failed: org.apache.http.client.HttpResponseException: Unauthorized W/System.err: org.apache.http.client.HttpResponseException: Unauthorized W/System.err: at com.loopj.android.http.AsyncHttpResponseHandler.sendResponseMessage(AsyncHttpResponseHandler.java:404) W/System.err: at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:161) W/System.err: at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:178) W/System.err: at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:109) W/System.err: at java.util.concurrent.Executors\$RunnableAdapter.call(Executors.java:422)
Created January 25, 2016 07:30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 UserRepository userRepo = adapter.createRepository(UserRepository.class); userRepo.loginUser(email, password, new UserRepository.LoginCallback() { @Override public void onSuccess(AccessToken token, Object currentUser) { } public void onError(Throwable t) {
Created October 5, 2015 13:19
JS Array's indexOfRegex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 var x = ['one', 'two', 'three']; Array.prototype.indexOfRegex = function(regex) { for(var i=0; i < this.length; i++) { if(this[i].search(regex) > -1) return i; } return -1; }
Last active August 29, 2015 14:04
Socket Server using Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 # http://facebook.com/code.we.bas import socket import sys from thread import * # Define HOST and PORT HOST = '' # Host, Can be Empty to work on all available interfaces. PORT = 8003 # Port to be used, must not be already used by another process.