Skip to content

Instantly share code, notes, and snippets.

View raulpy271's full-sized avatar
🌱
Simple is better than complex

Raul raulpy271

🌱
Simple is better than complex
View GitHub Profile
@raulpy271
raulpy271 / kill_discord.sh
Last active July 13, 2021 21:04
Using Discord in linux I have this problem: When the user click's in the close button , the Discord app don't exit, this script close it anyway!
#!/bin/bash
# Use without download:
# curl -s https://gist.githubusercontent.com/raulpy271/3a05c3fd138013fcc4edb9b8cbdc6ac1/raw/ee8b56ffbe54751402c766cf15a3a13bae6f1c7c/kill_discord.sh | bash
process='Discord'
proces_exist=`pidstat | grep -i $process`
if [ -n "$proces_exist" ]
then
@raulpy271
raulpy271 / tail-recursion.ml
Last active August 9, 2021 01:03
Creating a recursive program which use tail recursion
type float_operation = float -> float -> float
let shift (operation: float_operation) =
let is_sum = operation 1.0 1.0 = 2.0 in
if is_sum then (-.) else (+.)
;;
let calculate_pi ?(limit=20) () : float =
let rec calculate_a_pi_term
(term: int) (acc: float) (operation: float_operation): float =