Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Adeniji DanielAdeniji

View GitHub Profile
@DanielAdeniji
DanielAdeniji / DOSBatch.getDrive.cmd
Created Jul 9, 2022
DOS - Batch - Get Drive Letter
View DOSBatch.getDrive.cmd
@echo off
rem Get current drive letter in CMD
rem https://stackoverflow.com/questions/21069787/get-current-drive-letter-in-cmd
setlocal
rem get contextual information
set "_contextualDrive=%cd:~0,2%"
@DanielAdeniji
DanielAdeniji / TransactSQLFormatFunction.sql
Created Jun 16, 2022
Using Transact SQL Format Function
View TransactSQLFormatFunction.sql
set nocount on
go
declare @tblPerson table
(
[id] int not null
identity(1,1)
, [name] varchar(200) not null
View person.txt
john smith jsmith@nobody.com los angeles CA 90001
larry summers lsummers@treasury.gov new york-city NY 10001
twilla jacobs tjacobs@cincy.com cincinnati OH 45201
andy johnson ajohnson@yahoo.com miami FL 33101
tanya wilson twilson@gmail.com philadephia PA 19019
@DanielAdeniji
DanielAdeniji / stringCollectionDump.cs
Created Jun 1, 2022
Printing out the contents of a string collection
View stringCollectionDump.cs
using System.IO;
using System;
using System.Linq;
class Program
{
enum enumConversionChoice
{
convertToStringArray
View personListSortedByAge.ps1
Set-StrictMode -Version Latest
<#
Declare Person Object
#>
class person
{
[string] $name;
@DanielAdeniji
DanielAdeniji / repeatChar.js
Last active May 15, 2022
repeat Character in Node JS
View repeatChar.js
/*
Function:- repeatChar
*/
function repeatChar(ch, count)
{
/*
Declare buffer as an array
*/
var buffer = [];
var str = "";
View repeatChar.powershell.function.eitherOr.ps1
[string] $title;
[char] $ch;
[int] $len=0;
[string] $filler = "";
[boolean] $bCallFunctionWithComma = $false;
function repeatChar([char] $ch,[int] $n)
{
[String] $str = "";
View dos.batch.remarkStatement.specialChars.original.cmd
rem Adding Comments
rem https://www.nobody.com/?a=1
IF %ERRORLEVEL% NEQ 0 Echo errorlevel is %ERRORLEVEL%
View compile.cmd
setlocal
set "jar_log4j_version=2.17.1"
set "jar_log4j_explicit=lib/log4j/*"
set "jar_log4j_implicit=lib/log4j/log4j-api-%jar_log4j_version%.jar;lib/log4j/log4j-core-%jar_log4j_version%.jar;lib/log4j/log4j-1.2-api-%jar_log4j_version%.jar"
set "jar_log4j=%jar_log4j_implicit%"
View helloWorld.java
public class helloWorld
{
public static void main(String[] args)
{
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");
}
}