Skip to content

Instantly share code, notes, and snippets.

View sondr3's full-sized avatar
:octocat:
Rust or bust

Sondre Aasemoen sondr3

:octocat:
Rust or bust
View GitHub Profile
POSTGRES_DB=pantry_dev
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_HOST=localhost
@sondr3
sondr3 / findMin.js
Last active January 4, 2023 22:52
Recursive
const findMin = nums => findMinRec(nums[0], nums);
const findMinRec = (curr, nums) => {
if (nums.length === 0) return curr;
const min = curr < nums[0] ? curr : nums[0];
return findMinRec(min, nums.splice(1))
}
console.log(findMin([1, 2, 3]))
console.log(findMin([-10, 42, 18, 37, 99, -100]))
@sondr3
sondr3 / reverse.js
Created January 4, 2023 22:23
hue hue
const reverseString = (n) => {
for (var i = n.length - 1, o = ""; i >= 0; o += n[i--]) { }
return o;
}
console.log(reverseString("hello"));
console.log(reverseString("world"));
@sondr3
sondr3 / reverse.js
Created January 4, 2023 22:16
Recursive reverse
const reverseString = (input) => {
return (input === "") ? "" : reverseString(input.substring(1)) + input.charAt(0);
}
console.log(reverseString("hello"));
console.log(reverseString("world"));
@sondr3
sondr3 / exams.json
Created September 16, 2020 17:19
Exams
[
[
"BIF101",
{
"code": "BIF101",
"title": "Organismal Biology in Aquatic Medicine and Aquaculture",
"url": "https://www.uib.no/en/course/BIF101?sem=2020h",
"assessment": "Written examination (Ordinary exam)",
"exams": [
{

Keybase proof

I hereby claim:

  • I am sondr3 on github.
  • I am sondre (https://keybase.io/sondre) on keybase.
  • I have a public key whose fingerprint is 0EC3 FA89 EFBA B421 F82E 40B0 2567 6BCB FFAD 76B1

To claim this, I am signing this object:

(use-package flyspell
:config
(setq-default ispell-program-name "hunspell")
(setq ispell-really-hunspell t
ispell-dictionary "en_US"
ispell-silently-savep t
ispell-local-dictionary-alist
'(
("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)
("nb_NO" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)))
@sondr3
sondr3 / keybase.md
Created February 27, 2016 18:04
Keybase

Keybase proof

I hereby claim:

  • I am sondr3 on github.
  • I am sondre (https://keybase.io/sondre) on keybase.
  • I have a public key ASBN-yeXS_iBDl95lPT0SDI6dp9ukeSZc4Xas_QDkXiinAo

To claim this, I am signing this object:

@sondr3
sondr3 / test.rb
Last active November 21, 2015 21:23
# bin/test.rb
opts.on('--new:thing [NAME]', 'create a new thing') do |name|
if name.nil?
puts "you need to name your thing"
exit 0
end
options[:name] = name
puts "#{name}"
Test::CLI::New::Thing.new
end
@sondr3
sondr3 / gulpfile.js
Created September 14, 2015 15:50
Gulpfile
// Watch various files for changes and do the needful
gulp.watch(['src/**/*.md', 'src/**/*.html', 'src/**/*.yml'], gulp.series('jekyll:dev', reload));
gulp.watch(['src/**/*.xml', 'src/**/*.txt'], gulp.series('jekyll:dev'));