Skip to content

Instantly share code, notes, and snippets.

View mashcom's full-sized avatar
💭
Working

Blessing Mashcom Mashoko mashcom

💭
Working
View GitHub Profile
@mashcom
mashcom / trajectory.py
Last active August 29, 2015 14:02
this is beginners demo of how to calculate trajectory using python. this code is not validated and there are no exception catching mechanisms, it for learning purposes
# calculate trajetory
# @author: Mashoko Blessing
# @ http://www.facebook.com/blessing.mashcom
# @mashcom digimedia http://www.hookd-up.com
from math import sin,cos,pi
def calculateTraf(angle, velocity ):
#defining gravity
@mashcom
mashcom / factorial.py
Created June 16, 2014 11:36
calculate factorials in python.
# calculate factorial
# @author: Mashoko Blessing
# @http://www.facebook.com/blessing.mashcom
# @mashcom digimedia http://www.hookd-up.com
#email: bmashcom@hotmail.com
def factorial(x):
if(x==0):
return 1
else:
@mashcom
mashcom / files.py
Created June 16, 2014 11:50
files io basic
#read file
# calculate trajetory
# @author: Mashoko Blessing
# @ http://www.facebook.com/blessing.mashcom
# @mashcom digimedia http://www.hookd-up.com
import os
def isFileAvailable(myfile):
if(os.path.isfile(myfile)):
@mashcom
mashcom / arrays.c
Created June 16, 2014 11:53
basic array in c
#import <stdio.h>
int main(int argc, char * argv[]){
int areas[]={10,67,7,90,89};
printf("the size of ints id %ld",sizeof(int));
printf("the first character of array is %d",areas[0]);
return 0;
};
@mashcom
mashcom / forloop.c
Created June 16, 2014 11:55
basic forloop statement in c
# include <stdio.h>
int main(int argc, char * argv[]){
int i=0;
// go through each string in argv
// why am I skipping argv[0]?
for(i = 1; i < argc; i++) {
printf("arg %d: %s\n", i, argv[i]);
#include <stdio.h>
int main(int argc, char * argv[]){
int ages[]={12,56,23,34,51};
char *name[]={"blessing","tawanda","prosper","simba","titi"};
int count=sizeof(ages)/sizeof(int);
int i=0;
@mashcom
mashcom / wp_get_children.php
Created April 19, 2018 09:38
Get children of a current page
<?php
$id = the_ID();
while ( have_posts() ) : the_post();
$gp_args = array(
'post_type' => 'page',
'post_parent' => $id,
'order' => 'ASC',
'orderby' => 'menu_order',
'posts_per_page' => -1
);
@mashcom
mashcom / .htaccess
Created June 13, 2018 06:35
General Redirect Rules
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
<div class="alert alert-info font-weight-bold">
<p>To secure your place, kindly pay full fees by 31 May 2020.</p>
<p>How to download acceptance letter</p>
<ul>
<li>Create your elearning account at <a href="https://elearning.msu.ac.zw/login/create_account" target="_blank">https://elearning.msu.ac.zw/login/create_account</a></li>
<li>Login to your new elearning account</li>
<li>On your elearning dashboard click the "Download Acceptance Letter" button to dowload your acceptance letter</li>
</ul>
</div>
@mashcom
mashcom / patch.php
Created January 24, 2022 12:40
patch
<?php
namespace App\Http\Controllers;
use App\Models\Voter;
use Illuminate\Http\Request;
class VoterController extends Controller
{
/**