This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Image from 'next/image' | |
import HeroImage from '/public/hero.jpg' | |
export default function Hero() { | |
return ( | |
<div style={{ position: 'relative', width: '100%', height: '100vh' }}> | |
<Image | |
src={HeroImage} | |
alt="Picture of the author" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "bubble", | |
"version": "1.0.0", | |
"description": "", | |
"main": "bubbleSort.js", | |
"scripts": { | |
"test": "jest" | |
}, | |
"author": "", | |
"license": "ISC", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const binarySearch = (array, target) => { | |
// min and max are indexes | |
let min = 0 | |
let max = array.length - 1 | |
// while loop will run until min and max cross each other | |
while(min <= max) { | |
// find middle index | |
const middle = Math.floor((min + max) / 2) | |
const current = array[middle] | |
// determine if we need to search left or right or end if we found it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "daily-quest", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "jest" | |
}, | |
"author": "", | |
"license": "ISC", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Enable syntax highlighting | |
syntax on | |
" Enable line numbers | |
set number | |
" Show matching brackets | |
set showmatch | |
" Indenting Configs | |
set autoindent | |
set smartindent | |
set tabstop=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Random (StdGen, randomR, split, newStdGen) | |
-- main to help debug your Functor, Applicative and Monad instances | |
-- feel free to edit main! | |
main :: IO () | |
main = do | |
treeOne <- generateRandomTree 10 -- tree of ten random nodes | |
-- you will end of needing to construct a tree of expressions of some type (a -> a) for the applicative | |
-- you can construct that tree manually via value constructors or by creating a new generateTree function | |
print treeOne |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Random | |
main :: IO () | |
main = do | |
g1 <- newStdGen | |
g2 <- newStdGen | |
let tenRandomLetters = take 10 (randomRs ('a', 'z') g1) | |
let randomInts = take 10 (randomRs (1, 10) g2) | |
let mixLettersAndNumbers = [(letter, number) | letter <- randomLetters, number randomInts] | |
print mix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Vector a where | |
Vector :: (Num a) => a -> a -> a -> Vector a | |
deriving instance Show a => Show (Vector a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT='%{$fg[white]%}%c$(git_prompt_info): % %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}:%{$fg[yellow]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}%{$fg[red]%}-[*]" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}%{$fg[magenta]%}-[✓]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with GNAT.Sockets; | |
with Ada.Text_IO; | |
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; | |
with Ada.Streams; use Ada.Streams; | |
procedure Ada_Http_Post is | |
CRLF : constant String := ASCII.CR & ASCII.LF; | |
Host : constant String := "httpbin.org"; | |
Path : constant String := "/post"; | |
Host_Entry : constant GNAT.Sockets.Host_Entry_Type := | |
GNAT.Sockets.Get_Host_By_Name (Host); |
NewerOlder