Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Adeniji DanielAdeniji

View GitHub Profile
@DanielAdeniji
DanielAdeniji / commandLineArguments.sh
Last active Nov 29, 2020
Command Line Arguments in bash shell
View commandLineArguments.sh
#!/bin/bash
function validateArguments {
declare arrayArgs
declare numberofArgs=0
declare numberofExpectedArgs=0
declare rc=0
View fileTextWrite.sh
#!/bin/bash
function dataGenerate(){
declare n_=$1
declare -n aData_=$2
declare i_=0
declare dta_=0
View getTimestamp.sh
#!/bin/bash
function getTimestamp()
{
#declare a name reference
#The name reference should reference the first parameter
declare -n ts_=$1
ts_=`date +"%Y%b%d_%H%M%p"`
View function.string.functionReturn.sh
#!/bin/bash
function getUserInput()
{
#declare variables
local username_=""
#read data
read username_
View literature.txt
Blaise Pascal~Men never do evil so completely and cheerfully as when they do it from religious conviction.
Milton Friedman (Thomas Sowell: A Conflict of Visions, p130)~A society that puts equality -- in the sense of equality of outcome -- ahead of freedom will end up with neither equality nor freedom. The useof force to achieve equality will destroy freedom, and the force,
introduced for good purposes, will end up in the hands of people who use it to promote their own interests.
Alien vs. Predator~It's like a condom; I'd rather have it and not need it than need it and not have it.
Jamie Zawinski~Linux is only free if your time has no value.
Cicero~The function of wisdom is to discriminate between good and evil.
Alfred North Whitehead (Introduction to Mathematics)~Civilization advances by extending the number of important operations which we can perform without thinking about them.
Randy S. Nelson (dean of Pixar University)~It's no trick for talented people to be interesting, but it's a gift to be interested.
View MySQL.autoIncReset.dadeniji.resetcolumnAutoincrementReset.sql
drop procedure if exists columnAutoincrementReset
//
CREATE PROCEDURE columnAutoincrementReset(
IN tablename varchar(200)
)
BEGIN
@DanielAdeniji
DanielAdeniji / readfile.sh
Last active Oct 19, 2020
Bash - Readfile
View readfile.sh
#!/bin/bash
#set name of datafile
filedata="datafile/blackbook.txt"
#set the Internal File Separator
#in our case set to semi colon (;)
IFS=';'
#set line number
@DanielAdeniji
DanielAdeniji / departmentAdd.IdAsIdentity.Yes.sql
Created Oct 9, 2020
MySQL :- Department - Add - Id as Identity
View departmentAdd.IdAsIdentity.Yes.sql
create database if not exists testdb;
use testdb;
DROP PROCEDURE IF EXISTS departmentAdd;
DELIMITER //
CREATE PROCEDURE departmentAdd
(
@DanielAdeniji
DanielAdeniji / departmentAdd.idasIdentityNo.sql
Last active Oct 9, 2020
MySQL:- Add new entry into Department Table
View departmentAdd.idasIdentityNo.sql
create database if not exists testdb;
use testdb;
DROP PROCEDURE IF EXISTS departmentAddIdAsIdentityNo;
DELIMITER //
CREATE PROCEDURE departmentAddIdAsIdentityNo
(
@DanielAdeniji
DanielAdeniji / MySQLGroupConcatFunction.sql
Last active Oct 8, 2020
MySQL:- Using GROUP_CONCAT Function
View MySQLGroupConcatFunction.sql
create database if not exists testdb;
use testdb;
start transaction;
drop table if exists testdb.courseSchedule;
drop table if exists testdb.student;