Skip to content

Instantly share code, notes, and snippets.

View kilataban's full-sized avatar

Kila Taban kilataban

  • Juba, South Sudan
View GitHub Profile
@kilataban
kilataban / script.gs
Last active February 5, 2025 09:52
Mail Merge Script
function sendEmailsWithAttachments() {
var sheet =SpreadsheetApp.getActiveSheet();
var startRow = 2;
var numRows = sheet.getLastRow() - 1;
var dataRange = sheet.getRange(startRow, 1, numRows, sheet.getLastColumn());
var data = dataRange.getValues();
var plannerEmail = "planner@bash.example"
data.forEach(function(row){
var emailAddress = row[0];
@kilataban
kilataban / promisesAllSettled.js
Created January 16, 2024 18:59
This is a generic implementation of a function that handles JavaScript Promises with its accompanying methods
function promisesAllSettled(promises) {
return new Promise((resolve) => {
if (!Array.isArray(promises)) {
throw new TypeError('Argument must be an array of promises');
}
const results = [];
let settledCount = 0;
function checkAllSettled() {
@kilataban
kilataban / r_ubuntu_17_10.sh
Created June 13, 2019 13:41 — forked from Shuyib/r_ubuntu_17_10.sh
Install R on Ubuntu 17.10
# Install R
sudo apt-get update
sudo apt-get install gdebi libxml2-dev libssl-dev libcurl4-openssl-dev libopenblas-dev r-base r-base-dev
# Install RStudio
cd ~/Downloads
wget https://download1.rstudio.org/rstudio-xenial-1.1.383-amd64.deb
sudo gdebi rstudio-xenial-1.1.383-amd64.deb
printf '\nexport QT_STYLE_OVERRIDE=gtk\n' | sudo tee -a ~/.profile
@kilataban
kilataban / mnistCSVConvertor.py
Created July 27, 2018 12:40
My attempt at converting the training data set and data to a csv file
def convert(imgf, labelf, outf, n):
f = open(imgf, "rb")
o = open(outf, "w")
l = open(labelf, "rb")
f.read(16)
l.read(8)
images = []
@kilataban
kilataban / gist:94f77a7d7565e62ac19d7f6acbd3e36c
Created March 27, 2017 11:23 — forked from klgraham/gist:3768168
Call-by-name vs call-by-value in Scala
/* call-by-value means the parameters are evaluated left to
** right to determine their value before the function itself
** is evaluated
*/
def first(a: Int, b: Int): Int = a
first(3 + 4, 5 + 6) // will be reduced to first(7, 5 + 6), then first(7, 11), and then 7
/* call-by-name means the paramter is passed into the function
** as is. Parameter evaluation takes place after
** substitution