Skip to content

Instantly share code, notes, and snippets.

View jdgo-mars's full-sized avatar

João Martins jdgo-mars

View GitHub Profile
@jdgo-mars
jdgo-mars / prompting-gudelines.ipynb
Last active April 12, 2024 19:52
Prompt Engineering
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
syntax = "proto3";
package login;
message Login {
string name = 1;
string url = 2;
string username = 3;
string password = 4;
optional string notes = 5;
}

Note to self: Make a script that counts the words on an article and yield avg reading time.

React Primer

A gentle intro do react

const weekday = {
0: "Sunday",
1: "Monday",
2: "Tuesday",
3: "Wednesday",
4: "Thursday",
5: "Friday",
6: "Saturday",
}
@jdgo-mars
jdgo-mars / index.html
Created November 11, 2020 23:40
ClariProject
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Clarisa Abalasei</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script src="index.js" defer></script>
<header>
var SBMonitor = []
var sysCallMap = {};
function getDiff(key) {
let diff = 0;
const now = new Date().getTime();
if(sysCallMap[key]) {
diff = now - sysCallMap[key];
}
sysCallMap[key] = now;
@jdgo-mars
jdgo-mars / guessing_game.ex
Created November 29, 2019 19:40
Alchemist Camp
defmodule GuessingGame do
def guess(a, b) when a > b, do: guess(b, a)
def guess(low, high) do
answer = IO.gets("Maybe you thinking of #{mid(low, high)}? ")
case String.trim(answer) do
"bigger" ->
bigger(low, high)
<!DOCTYPE html>
<!--
*
* Copyright (C) 2016, bitmovin GmbH, All Rights Reserved
*
* This source code and its use and distribution, is subject to the terms
* and conditions of the applicable license agreement.
*
-->
<html lang="en">
class LinkList {
constructor(value) {
this._head = { value, next: null };
this._tail = this._head;
}
insert(value) {
//update tail as needed
const node = { value, next: null };
this._tail.next = node;
function BinarySearchTree(val) {
this.value = val;
this.left = null;
this.right = null;
}
BinarySearchTree.prototype.insert = function(value) {
let subtree = value < this.value ? 'left' : 'right';
if (this[subtree]) {
this[subtree].insert(value);