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
<?php | |
class Kernel extends BaseKernel | |
{ | |
use MicroKernelTrait; | |
const CONFIG_EXTS = '.{php,xml,yaml,yml}'; | |
public function getCacheDir() | |
{ |
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
def to_hex(decimal) | |
decimal_remainder = decimal % 16 | |
hexchars = "0123456789ABCDEF" | |
div = decimal / 16 | |
if div == 0 | |
hexchars[decimal_remainder].to_s | |
else | |
to_hex(div) + hexchars[decimal_remainder].to_s | |
end | |
end |
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
class Test | |
@stored = [] of Proc(Nil) | |
def captured(&block) | |
@stored << block | |
end | |
def example | |
@stored.each do |b| | |
b.call() | |
end |
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
## Requires newer versions of ubuntu, I'm using Ubuntu 20 | |
# install nginx | |
sudo apt install nginx | |
# add php8.X repository | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt update | |
# search libraries |
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
function say(a) { | |
cleanUp = function(str) { | |
return str.replace(/[^a-zA-Z0-9]+/, ""); | |
} | |
addDashes = function(str) { | |
return cleanUp(str).split("").join("-"); | |
} | |
return function(b) { |
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
function say(a) | |
{ | |
splitUp = function(data) { | |
dataArray = data.split("") | |
stringArray = []; | |
for(x = 0; x < dataArray.length; x++) { | |
if(dataArray[x].match(/[a-zA-Z0-9]/)) { | |
stringArray[stringArray.length++] = dataArray[x]; | |
} | |
} |
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
#idiotcoder.com | |
#eatcodegame.com | |
class RouteParser | |
@default_regex_replacement = "w+" | |
getter regex_variables = {} of String => String | |
getter default_variables = {} of String => String | |
getter matched_variables = [] of String |
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
class Route | |
def initialize(@route = "") | |
end | |
def route | |
@route | |
end | |
end | |
class RouteContainer |
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
# idiotcoder.com | |
def example(&ex) | |
ex.call() | |
end | |
example &-> { | |
puts "sup" | |
} |
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
def example(&ex) | |
ex.call() | |
end |