Skip to content

Instantly share code, notes, and snippets.

@s0kil
s0kil / matrixSnail.js
Last active May 6, 2020 15:16
Matrix Snail
// Returns Items's Outside Of The Matrix.
function matrixTrack(array) {
const result = [];
function sprint(callback, reverse = false) {
const sprintLength = array.length - 1;
if (reverse) {
for (let i = sprintLength; i > 0; i--) {
callback(i, array.length - 1);
}
@s0kil
s0kil / Vitality.md
Last active May 12, 2020 01:32
Vital Sources For Memory, Focus, Energy, and Continuous Vitality (Focused On Long Term Performance)

Supplements To:

  • Consume (Burn Fuel)
  • Sustain (Re-Fuel)

Omega

  • DHA 150 mg
  • EPA 150 mg

Vitamin B Complex

  • B1 (Thiamine) 3 mg
@s0kil
s0kil / show_hidden_startup_program_ubuntu.md
Last active December 22, 2022 19:31
Show Hidden Startup Program In Ubuntu Based OS/Distro

This is just a quick find and replace command that changes the NoDisplay=false with NoDisplay=true in all the programs that are in autostart. Once you do this, open Startup Applications and you shall see many more programs here:

sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop
sudo sed -i 's/Hidden=true/Hidden=false/g' /etc/xdg/autostart/*.desktop

sed -i 's/NoDisplay=true/NoDisplay=false/g' ~/.config/autostart/*.desktop
sed -i 's/Hidden=true/Hidden=false/g' ~/.config/autostart/*.desktop
@s0kil
s0kil / netlify-security-headers.md
Last active May 27, 2020 16:48
Netlify Security Headers
[[headers]]
for = "/*"

[headers.values]
X-Frame-Options = "DENY"
Referrer-Policy = "no-referrer"
X-XSS-Protection = "1; mode=block"
X-Content-Type-Options = "nosniff"
X-Permitted-Cross-Domain-Policies = "none"
@s0kil
s0kil / Fibonacci_OCaml_Crystal_Go.md
Last active June 29, 2022 10:44
Crystal vs Ocaml vs Go Fibonacci Benchmark

Fibonacci - Crystal vs OCaml vs Go

Crystal

Program: fibonacci.cr

def fibonacci(n)
  return n if n < 2
  fibonacci(n - 1) + fibonacci(n - 2)
@s0kil
s0kil / server.cr
Created June 25, 2020 02:43
Crystal HTTP Server
require "http/server"
server = HTTP::Server.new do |context|
context.response.content_type = "text/plain"
context.response.print "Hello from #{context.request.path}!"
end
System.cpu_count.times do |_|
Process.fork do
server.listen(host = "0.0.0.0", port = 8000, reuse_port = true)
@s0kil
s0kil / palindrome_index.rb
Last active July 31, 2020 15:12
Palindrome Index By Removing Offender
# frozen_string_literal: true
# This algorithm finds the offender (character that stops the string from being an palindrome)
# And returns the index of that character
def palindrome_index(string)
def is_palindrome(s)
s == s.reverse
end
@s0kil
s0kil / TSC_DEADLINE-disabled.md
Last active August 7, 2020 18:21
TSC_DEADLINE disabled due to Errata