Skip to content

Instantly share code, notes, and snippets.

View ibrahim-kardi's full-sized avatar

Mohammad Ibrahim ibrahim-kardi

View GitHub Profile
@ibrahim-kardi
ibrahim-kardi / 👀.md
Created May 13, 2017 04:39 — forked from notwaldorf/👀.md
Advice for new developers

Someone sent me an email asking me what advice I had for new developers. I get this question a bunch, so I wanted to put all my thoughts in one place, that I can update as I get more ideas!

I answered this a bunch on my AMA repo, so here's some initial general answers, before I get to some of the specific questions:

@ibrahim-kardi
ibrahim-kardi / KFM2-1.py
Created August 10, 2017 18:21
null created by ikardi420 - https://repl.it/KFM2/1
def fafib(n,memo={}):
"""Assumes n is an int>=0,memo used only by recursive calls Return Fibonacci of n"""
if n == 0 or n == 1:
return 1
try:
return memo[n]
except KeyError:
result= fafib(n-1,memo)+fafib(n-2,memo)
memo[n]=result
return result
<html>
<head>
<title>API Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var accessToken = "<your agent's client access token>";
var baseUrl = "https://api.api.ai/v1/";
from google.colab import files
files.upload() #this will prompt you to upload the kaggle.json
!pip install -q kaggle
!mkdir -p ~/.kaggle
!cp kaggle.json ~/.kaggle/
!ls ~/.kaggle
!chmod 600 /root/.kaggle/kaggle.json # set permission
#than copy the kaggle API
!kaggle datasets download -d sohaibanwaar1203/prepossessed-arrays-of-binary-data
#not necessary
conda install -c conda-forge opencv
#file acess permission
chmod +x copy.sh
@ibrahim-kardi
ibrahim-kardi / copy_file.sh
Created November 5, 2019 16:25
copy a file bash code for ubuntu
#!/bin/bash
i=2
while (( i++ < 1000 )); do
cp ka1.txt "test$i.txt"
done
@ibrahim-kardi
ibrahim-kardi / git command
Created November 12, 2019 17:34
necessary git comand
# to initialize
git init
#Add the files in your new local repository. This stages them for the first commit
git add .
#Commit the files that you’ve staged in your local repository
git commit -m "initial commit"
#add the URL for the remote repository where your local repository will be pushed
{
"categories": [
{
"name": "Electronics",
"slug": "",
"description": "",
"meta": "",
"order": 0,
"child":[
add_shortcode( 'sales', 'show_sales_by_product_id' );
function show_sales_by_product_id( $atts ) {
$atts = shortcode_atts( array(
'id' => ''
), $atts );
$units_sold = get_post_meta( $atts['id'], 'total_sales', true );