Skip to content

Instantly share code, notes, and snippets.

View egroj97's full-sized avatar
😀

Jorge Luis Rodríguez González egroj97

😀
  • Orison Inc.
  • Mérida, Venezuela
  • X @egroj97
View GitHub Profile
@egroj97
egroj97 / esalee-db-final.sql
Created January 12, 2022 04:13
Final project for ESLAEE DB Course.
CREATE TABLE IF NOT EXISTS locations
(
timezone CHARACTER NOT NULL,
latitude INTEGER NOT NULL,
ocean VARCHAR(255) NOT NULL,
geographic_reference VARCHAR(255),
name VARCHAR(255),
PRIMARY KEY (timezone, latitude)
);
@egroj97
egroj97 / rpi_gpio_keys.dts
Created November 7, 2021 01:35
DTS to add GPIO keys as overlay on the Raspberry Pi
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target-path = "/soc";
__overlay__ {
keypad: keypad {
compatible = "gpio-keys";
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int
main ()
{
int i, h, leg1, leg2, primleg, segleg;
fn main() {
// Variables can be type annotated.
let logical: bool = true;
let a_float: f64 = 1.0; // Regular annotation
let an_integer = 5i32; // Suffix annotation
// Or a default will be used.
let default_float = 3.0; // `f64`
let default_integer = 7; // `i32`
# All the primes...
constant p = [ (1..∞).grep(&is-prime) ];
# The definitions of "strong" and "weak"...
sub strong (\n) { n > 0 && p[n] > p[n-1, n+1].sum/2 }
sub weak (\n) { n > 0 && p[n] < p[n-1, n+1].sum/2 }
# All the strong and weak primes...
constant strong-p = p.kv.map: ->\n,\pₙ {pₙ if strong n};
constant weak-p = p.kv.map: ->\n,\pₙ {pₙ if weak n};
const oneSecond = () => 1000
const getCurrentTime = () => new Date()
const clear = () => console.clear()
const log = message => console.log(message)
const compose = (...fns) =>
(arg) =>
fns.reduce(
(composed, f) => f(composed),
arg
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Print("Go runs on ")
switch os := runtime.GOOS; os {
# include <fstream>
# include <iostream>
# include <string>
# include <iomanip>
using namespace std;
struct Items
{
string name;
@egroj97
egroj97 / letter_guesser.cc
Created April 25, 2018 00:42
A program that makes you guess a letter out and helps you if you have a hard time on it!
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
@egroj97
egroj97 / letter_guesser.cc
Created April 25, 2018 00:42
A program that makes you guess a letter out and helps you if you have a hard time on it!
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{