Skip to content

Instantly share code, notes, and snippets.

View BroVic's full-sized avatar
🎯
Focusing

Victor Ordu BroVic

🎯
Focusing
View GitHub Profile
@BroVic
BroVic / Twitcurl.cpp
Created January 18, 2018 10:27 — forked from komasaru/Twitcurl.cpp
C++ source code to tweet by twitcurl library.
/**
* Tweet by twitcurl
*/
#include <iostream>
#include <string>
#include <twitcurl.h>
using namespace std;
/*
@BroVic
BroVic / gist:3502366f7855cd0c660320beb8cd4e5f
Last active March 9, 2018 17:54 — forked from dieulinh110/gist:0b5b17f10b2807c648b482682449b3fc
Calculating the sum of rows in each column group
## LOAD PACKAGE
library(dplyr)
## INPUT
input <- data.frame(president = c("A1", "A1", "A1", "A1", "A1", "A1", "A1"),
vice_president = c("B", "B", "B", "B", "C", "C", "C"),
manager = c("D", "D", "E", "E", "F", "G", "H"),
staff = c("I", "J", "K", "L", "M", "N", "O"),
qty_1 = c(1:7),
@BroVic
BroVic / wk1-downloads.ps1
Last active April 27, 2018 22:04
Quick download for course videos
# wk1-downloads
$wkVid1 = @("https://edx-video.net/PENPWJSX2017-V000500_DTH.mp4")
$vidNames = @("1.1-intro-www-internet.mp4")
$wkVid1 += "https://edx-video.net/PENPWJSX2017-V000500_DTH.mp4"
$vidNames += "1.2-how-webrowser-works.mp4"
$wkVid1 += "https://edx-video.net/PENPWJSX2017-V000100_DTH.mp4"
@BroVic
BroVic / video-download.ps1
Last active April 30, 2018 12:43
Quick download for course videos (part 2)
# video-download.ps1
# Takes an array of video URLs and downloads them into the working directory
# and renames them
function Get-EdxVideos {
param([string[]]$UrlArray, [string[]]$NewNames)
for ($i = 0; $i -lt $UrlArray.Length; $i++) {
@BroVic
BroVic / install-r.ps1
Created January 22, 2019 02:34
Download and install R from CRAN
# startup.ps1
# Version of the file will download R v. 3.5.2
$downloadUrl = "https://cloud.r-project.org/bin/windows/base/R-3.5.2-win.exe"
$executable = Split-Path $downloadUrl -Leaf
$downloadLoc = Join-Path -Path $home -ChildPath "Desktop"
$newPath = Join-Path $downloadLoc -ChildPath $executable
Start-BitsTransfer -Source $downloadUrl -Destination $newPath
if (!requireNamespace('remotes'))
install.packages('remotes')
remotes::install_github('DevSolutionsLtd/ariseng')
@BroVic
BroVic / enumerations.cpp
Last active April 21, 2019 23:34
Scoped and Unscoped Enumerations
// Scoped and Unscoped Enumerations
#include <iostream>
#include <array>
#include <string_view> // C++ 17
enum EShape
{
eCircle,
eSquare,
@BroVic
BroVic / mario.R
Last active July 13, 2019 02:54
R implementation of CS50x's Problem Set 6 - mario, more comfortable
# mario.R
printCharInSeq <- function(char, num) {
for (n in seq_len(num)) {
cat(char)
}
}
prompt <- "Height: "
@BroVic
BroVic / excel_to_posix_date.ps1
Created July 30, 2019 08:12
When Excel messes up your CSVs
# Converting Date Entries in a CSV file back to POSIX style (after being mucked up by MS Excel)
# Note: The first column is for Dates
Param(
[string]$file,
[switch]$Detailed
)
$tempfile = New-TemporaryFile
@BroVic
BroVic / setup.R
Last active August 22, 2019 15:16
Setting up for Arise Nigeria Conference
if (!requireNamespace("remotes"))
install.packages("remotes", repos = "https://cran.rstudio.com")
remotes::install_github("DevSolutionsLtd/AriseNg/ariseng")
library(ariseng)
fetch_settings()
fetch_dependencies()
DataEntry::DataEntry()