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
#!/bin/bash | |
echo "\nRunning rubocop 🤖 🚓 💨 \n" | |
declare -a ERRORS=() | |
if git diff HEAD --name-only | grep -q -E '\.rb$'; then | |
ERRORS+=$(git diff HEAD --name-only | \ | |
grep -E '.rb' | \ | |
xargs docker compose run --rm web bundle exec rubocop | \ |
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
#include "raylib.h" | |
#include <string.h> | |
typedef struct S_input_properties { | |
Color outline_color; | |
Color text_color; | |
int font_size; | |
} input_properties; | |
input_properties create_input_properties(Color outline_col, Color text_col, int font_size) { |
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 Object | |
HASH = {} | |
def label(name, &block) | |
HASH[name] = proc(&block) | |
end | |
def goto(name) | |
raise "No label with name #{name} found" unless HASH.key?(name) |
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
# http://www.mathrecreation.com/2014/09/squashing-multiples.html | |
inp = ARGV[0].to_i | |
raise 'Expected a number as an input' if inp.nil? || ARGV[0].nil? | |
while inp > 10 | |
dig = inp.to_s.chars.map(&:to_i).sum | |
puts dig | |
inp = dig | |
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
<html style='background-color: black'> | |
<div id="my_bouncing_box" style= "background-color: blue; border-radius: 3px; position: absolute; left: 0px; top: 0px; min-width: 100px; min-height: 100px; text-align: center; font-weight: bold; color: #999;" > Bouny bounce</div> | |
<script type="text/javascript"> | |
const BOX = document.getElementById('my_bouncing_box'), | |
SIZE = 100, | |
WINDOW_X = window.innerWidth - SIZE; | |
WINDOW_Y = window.innerHeight - SIZE; | |
let x = 0; | |
let y = 0; |
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
/* | |
//Basic usage: | |
std::string base("@X, \"@X @X\"@X"); | |
std::string args[4] = { "Hello", "John", "Doe", "!"}; | |
std::cout << '\"' << interpolate(base, args) << '\"' << '\n'; | |
// It can also work with arguments next to one another | |
// and with std::initializer_list |
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
; String length calculation function | |
strlen: | |
push rdi | |
mov ebx, eax | |
__nextc: | |
cmp byte [eax], 0 | |
jz __finish | |
inc eax | |
jmp __nextc |
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
PORT=$1 #the script will expect one argumnet - the port number. | |
if [ ! -z "$PORT" ]; then | |
kill -9 $(lsof -t -i:$PORT -sTCP:LISTEN); | |
echo "Killed all processes on port $PORT" | |
else | |
echo 'Provide a port to kill!' | |
fi |