Skip to content

Instantly share code, notes, and snippets.

View EDDYMENS's full-sized avatar
🏕️

Edmond Mensah EDDYMENS

🏕️
View GitHub Profile
from decimal import Decimal
number = 2
x = (number/2)
for _ in range(10000):
x = Decimal( x - ( ((x**2)-2) / (2*x) ) )
print(x)
from decimal import Decimal
def find_square_root(number, decimal_places, current_result=None, current_decimal_place=1):
# Find the integer part of the square root
if current_result is None:
current_result = int(number / 2)
# Check if we have computed the required number of decimal places
if current_decimal_place-1 == decimal_places:
return current_result
@EDDYMENS
EDDYMENS / tinkerMod.php
Last active August 15, 2023 07:08
Script to reload Laravel Tinker sessions without existing
<?php
use Illuminate\Support\Facades\Process;
$__tinkerModeDefinedVars__ = get_defined_vars();
$_reload = function ($lineStart = null, $endLine = null) use ($__tinkerModeDefinedVars__) {
$histFile = '.__tinkerMode__history.php'; //stores executable history
{
"openapi": "3.0.1",
"info": {
"title": "Questionnaire Links API",
"description": "The questionnaire link API.\n",
"version": "1.0.0"
},
"/questionnaire-links": {
"get": {
"tags": [
@EDDYMENS
EDDYMENS / open-api-template.yaml
Created March 19, 2023 16:48
Simple Open API starter template
openapi: 3.0.3
info:
title: Simple OpenAPI template
description: |
Simple open API template
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.11
servers:
@EDDYMENS
EDDYMENS / reqres.openapi.json
Last active March 5, 2023 09:50
Reqres Open API Spec
{
"openapi": "3.0.3",
"info": {
"title": "SDK example - OpenAPI 3.0",
"description": "This spec is meant to demonstrate how to use the SDK generator by readme.io",
"version": "1.0.11"
},
"servers": [
{
"url": "https://reqres.in/api"
alert("shows up");
@EDDYMENS
EDDYMENS / Surreal.php
Last active March 17, 2024 16:43
Surreal DB PHP SDK
<?php
/**
* Surreal fluent query
*
* @author EDDYMENS
* @license MIT (or other licence)
*/
class Surreal
{
<?php
class MiniRetirement {
private $workedYears = 0;
private $retirementYears = 0;
private $totalYears = 0;
private $unaccountedYears = 0;
public function __construct($totalYears) {
openapi: 3.0.0
info:
description: The books endpoint keeps a record of books and their page numbers
version: 1.0.0
title: Book API
servers:
- url: https://lit-taiga-02928.herokuapp.com
- url: http://lit-taiga-02928.herokuapp.com
paths:
/: