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
# Feel free to use and modify | |
import os | |
import re | |
import git | |
pattern = r"^9\d{2}-.*" #Give some pattern of repos if needed | |
for name in os.listdir("."): | |
parent_dir = os.getcwd() | |
if os.path.isdir(name) and re.match(pattern, name): | |
os.chdir(name) |
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
import csv | |
import os | |
src = 'Users.csv' | |
dst = 'Users_new.csv' | |
with open(src, 'rb') as inp, open(dst, 'wb') as out: | |
writer = csv.writer(out) | |
reader = csv.reader(inp) | |
next(reader, None) |
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
<?php | |
// ..... add the following in wordpress functions.php file | |
/** | |
* Yoast Rest API Customized | |
*/ | |
function wp_yoast_rest( WP_REST_Request $request ){ | |
$post_id = $request ['post_id']; | |
$title = $request['seo_title']; | |
$desc = $request['seo_desc']; |
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
#!/usr/bin/python | |
import urllib | |
def get_page(page): | |
if(seed != ''): | |
return urllib.urlopen(page).read() | |
else: | |
return '' | |
def get_next_url(page): |
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
#!/usr/bin/python | |
# This program is written without using any built-in functions | |
# Not using Lists, as a practice for students learning Python | |
def isLeapYear(year): | |
if ((year%4 == 0 and year%100 != 0)) or year%400 == 0: | |
return True | |
return False | |
def daysInMonth(year, month): | |
if month in {1,3,5,7,8,10,12}: |
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
#!/usr/bin/python | |
import urllib | |
def get_page(url): | |
if(url): | |
return urllib.urlopen(url).read() | |
else: | |
return '' | |
def get_next_url(page): |
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
#! /usr/bin/python | |
import urllib, json | |
URL = "https://api.github.com/users/rathankalluri/gists" #https://api.github.com/users/<git-hub username>/gists | |
response = urllib.urlopen(URL) | |
data = json.loads(response.read()) | |
for i in range(0,len(data)): | |
filename = data[i]['files'].values()[0]['filename'] |
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
#!/bin/sh | |
#function for my use | |
makedir() | |
{ echo -e "Listing all Directories and Files Present Under Home \n========================================"|cat >cr_file_for_test.txt | |
echo -e "\nDirectories\n--------------"|cat >>cr_file_for_test.txt | |
find /home -type d |cat >>cr_file_for_test.txt # I need only the directories in home so 'find @ home only of type d' | |
echo -e "\nFiles\n--------"|cat >>cr_file_for_test.txt | |
find /home -type f |cat >>cr_file_for_test.txt | |
echo "File cr_file_for_test.txt created" | |
} |
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
#! /bin/bash | |
# This is my very first program in IT industry :D | |
#This programme is for creating qr codes for the data in the database and storing those codes back into the database. | |
#Functions used are in the beggining | |
# | |
#====================START OF dirfun()..(creates directory)================ | |
# | |
dirfun() | |
{ cd /home/rathankalluri/Rathan/ | |
if [ -d qrcodes ] |
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
import turtle | |
""" Draw a flower in Pyhton""" | |
def draw_square(square): | |
for i in range(0,2): | |
square.forward(100) | |
square.right(30) | |
square.forward(100) | |
square.right(150) |
NewerOlder