Skip to content

Instantly share code, notes, and snippets.

View arsho's full-sized avatar

Ahmedur Rahman Shovon arsho

View GitHub Profile
@arsho
arsho / mysql_data_insert.cs
Last active November 10, 2016 09:50
C# MySQL Data insertion using mysql-connector-net-5.1.7-noinstall, Visual Studio 2015.
string connetionString = null;
connetionString = "server=localhost;database=device_db;uid=root;pwd=123;";
using (MySqlConnection cn = new MySqlConnection(connetionString))
{
try
{
string query = "INSERT INTO test_table(user_id, user_name) VALUES (?user_id,?user_name);";
cn.Open();
using (MySqlCommand cmd = new MySqlCommand(query, cn))
@arsho
arsho / README.md
Created November 18, 2016 18:18 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

@arsho
arsho / allow_letters_only.py
Created November 20, 2016 18:04
Using regular expression to allow only a to z and A to Z letters
import re
word = input()
if(re.match(r'^[a-zA-Z]+$',word)):
print("matched")
else:
print("not matched")
@arsho
arsho / remove_list_item.py
Created November 23, 2016 06:54
Removing a list item using remove method
a = {'pantera' : ['cemetary gates','cowboys from hell','nothing else matters']}
a["pantera"].remove('nothing else matters')
print(a)
# output: {'pantera': ['cemetary gates', 'cowboys from hell']}
@arsho
arsho / a.py
Created December 12, 2016 06:51
Python __name__ functionality. First run a.py file. Then run b.py file to see the difference
if __name__ == '__main__':
print("Running directly from a.py")
else:
print("a.py is imported")
# run python a.py
@arsho
arsho / e_bomb.py
Created December 14, 2016 08:03
Run the script in own risk!!!
# shared by: Protul
import subprocess
while 1:
subprocess.Popen('cmd')
@arsho
arsho / Ubuntu_Virtualenv_data_science.txt
Created December 25, 2016 05:28
Installation process of data science libraries in Ubuntu
Before Installation
=========================
#To generate graph in png format,
#Install following dependent packages
sudo apt-get install libpng-dev
sudo apt-get install libfreetype6-dev
#TkAgg for the TkInter windowing system
sudo apt-get install tcl-dev tk-dev python-tk python3-tk
@arsho
arsho / docs_mongodb.js
Last active January 5, 2017 13:09
Hide every tags of a page except one specific ID
$("body>:not(.document)").hide();
$(".document").appendTo("body");
@arsho
arsho / global_variable_express.js
Last active January 13, 2017 09:54
This little script saves a global variable in express js. It count how many times an user visit the root of the website which is in this case http://localhost:3000/
var express = require("express")
var app = express()
app.locals.global_value = 0;
app.get("/",function(req,res){
app.locals.global_value += 1;
res.send("<h3>Welcome!</h3>. You have visitied this page: "+app.locals.global_value+" times.");
})
app.get("*",function(req,res){
res.send("You are nowhere! Please click on this <a href=\"/\">link</a> to go to homepage.");
})
@arsho
arsho / test_pypi.py
Last active February 22, 2017 08:48
Copyusb usecase
#sudo pip3 install copyusb
import copyusb
a = copyusb.copy()
print(a)