Skip to content

Instantly share code, notes, and snippets.

View ultrox's full-sized avatar
🏠
Working from home

Marko Vujanic ultrox

🏠
Working from home
View GitHub Profile
@ultrox
ultrox / nixos.md
Created July 23, 2021 03:41 — forked from martijnvermaat/nixos.md
Installation of NixOS with encrypted root
;; PROBLEM:
;; Create function that satisfiy following example
(check-expect (number-list (list "first" "second" "third"))
(list "1: first" "2: second" "3: third"))
(define (number-list n) empty) ; stub
;; #1 Objective:
;; - Satisfy all design elements (or as much as posible)
@ultrox
ultrox / yell-starter.scm
Created December 25, 2020 15:47
yell function - first non guided function
;; yell-starter.rkt
; PROBLEM:
;
; DESIGN a function called yell that consumes strings like "hello"
; and adds "!" to produce strings like "hello!".
;
; Remember, when we say DESIGN, we mean follow the recipe.
;
; Leave behind commented out versions of the stub and template.
@ultrox
ultrox / pluralize.scs
Last active December 25, 2020 15:50
Guided pluralize functions
; Problem: Design a function that pluralizes a given word.
; (Pluralize means to convert the word to its plural form.)
; For simplicity you may assume that just adding s is enough to pluralize a word
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; What is an appropriate signature for this function?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ultrox
ultrox / debugger pause beforeunload
Created November 24, 2020 16:28 — forked from carcinocron/debugger pause beforeunload
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@ultrox
ultrox / resources.md
Last active June 30, 2023 22:54
Building Dactyl
model User {
  id        Int      @id @default(autoincrement())
  email     String   @unique
  role      Role      // normal Relation field 
  profile   Profile?  // Relation field part of 0-1 relation
}

model Profile {
 id Int @id @default(autoincrement())
@ultrox
ultrox / groupAnagrams.js
Created April 6, 2020 23:46
groupAnagrams.js
// Given an array of strings, group anagrams together.
/**
* @param {string[]} strs
* @return {string[][]}
* @description Given an array of strs, group anagrams together.
* @note inputs will be in lowercase.
The order of your output does not matter.
*/
@ultrox
ultrox / maxSubArray.js
Created April 4, 2020 14:01
maxSubArray
// Cubic O(n³)
// https://www.youtube.com/watch?v=2MmGzdiKR9Y Feb: 01/2019
function maxSubArray(nums) {
let maximumSubArraySum = Number.NEGATIVE_INFINITY;
/*
We will use these outer 2 for loops to investigate all
windows of the array.
We plant at each 'left' value and explore every
@ultrox
ultrox / resetFieldset.css
Created March 6, 2020 11:30 — forked from nicolasrenon/resetFieldset.css
Reset fieldset and legend styles
/* From http://thatemil.com/blog/2015/01/03/reset-your-fieldset/ by Emil Björklund */
legend {
display: table;
padding: 0;
}
fieldset {
border: 0;
margin: 0;
min-width: 0;