Skip to content

Instantly share code, notes, and snippets.

Avatar
💪
Getting after it

Ayooluwa ayoisaiah

💪
Getting after it
View GitHub Profile
@ayoisaiah
ayoisaiah / main.go
Created Dec 26, 2020
Multipart requests in Go (feat Google Drive API)
View main.go
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"mime/multipart"
"net/http"
"net/textproto"
@ayoisaiah
ayoisaiah / main.rs
Last active Dec 7, 2020
Find Mean, Median and Mode in Rust
View main.rs
use std::collections::HashMap;
fn mean(numbers: &Vec<i32>) -> f32 {
let sum: i32 = numbers.iter().sum();
sum as f32 / numbers.len() as f32
}
View gist:f3e43b496019c5866e6e2c1064b403fb
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAPNRAAEAAAABFsxYWVogAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+EAAC2z2Rlc2MAAAAAAAAAFklFQyBodHRwOi8vd3d3LmllYy5jaAAAAAAAAAAAAAAAFklFQyBodHRwOi8vd3d3LmllYy5jaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkZXNjA
@ayoisaiah
ayoisaiah / main_test.go
Created Oct 8, 2020
Benchmarking two unique ways to get a filename without the extension in Go
View main_test.go
package main
import (
"testing"
)
var res string
func BenchmarkFileNameWithoutExtSliceNotation(b *testing.B) {
// run the Fib function b.N times
@ayoisaiah
ayoisaiah / timer.go
Last active Sep 8, 2020
Countdown timer in Golang
View timer.go
// Tutorial: https://freshman.tech/golang-timer/
package main
import (
"flag"
"fmt"
"os"
"time"
)
@ayoisaiah
ayoisaiah / main.js
Last active Aug 3, 2020
Pomodoro tutorial - Checkpoint 8
View main.js
const timer = {
pomodoro: 25,
shortBreak: 5,
longBreak: 15,
longBreakInterval: 4,
sessions: 0,
};
let interval;
@ayoisaiah
ayoisaiah / main.js
Created Aug 3, 2020
Pomodoro Tutorial — Checkpoint 7
View main.js
const timer = {
pomodoro: 25,
shortBreak: 5,
longBreak: 15,
longBreakInterval: 4,
sessions: 0,
};
let interval;
@ayoisaiah
ayoisaiah / main.js
Created Aug 3, 2020
Pomodoro Tutorial — Checkpoint 6
View main.js
const timer = {
pomodoro: 25,
shortBreak: 5,
longBreak: 15,
longBreakInterval: 4,
sessions: 0,
};
let interval;
@ayoisaiah
ayoisaiah / main.js
Created Aug 3, 2020
Pomodoro Tutorial — Checkpoint 5
View main.js
const timer = {
pomodoro: 25,
shortBreak: 5,
longBreak: 15,
longBreakInterval: 4,
sessions: 0,
};
let interval;
@ayoisaiah
ayoisaiah / main.js
Last active Aug 3, 2020
Pomodoro Tutorial — Checkpoint 4
View main.js
const timer = {
pomodoro: 25,
shortBreak: 5,
longBreak: 15,
longBreakInterval: 4,
sessions: 0,
};
let interval;
You can’t perform that action at this time.