Skip to content

Instantly share code, notes, and snippets.

View cpl's full-sized avatar
📐
We meet upon the level; We part upon the square;

Αlexandru-Paul  Copil cpl

📐
We meet upon the level; We part upon the square;
View GitHub Profile
@cpl
cpl / countries_codes_and_coordinates.csv
Created February 1, 2021 08:58
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude coordinates FROM https://gist.github.com/tadast/8827699, without duplicates
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Albania AL ALB 8 41 20
Algeria DZ DZA 12 28 3
American Samoa AS ASM 16 -14.3333 -170
Andorra AD AND 20 42.5 1.6
Angola AO AGO 24 -12.5 18.5
Anguilla AI AIA 660 18.25 -63.1667
Antarctica AQ ATA 10 -90 0
Antigua and Barbuda AG ATG 28 17.05 -61.8
@cpl
cpl / example.go
Created November 23, 2020 14:52
Go Enums Quick Example
package example
type AnimalType uint8
const (
AnimalTypeUnknown AnimalType = iota
AnimalTypeDog
AnimalTypeCat
AnimalTypeRabbit
AnimalTypeSnake
package main
import "fmt"
func main() {
if '🐔' < '🥚' {
fmt.Println("chicken came first")
}
}
@cpl
cpl / genome.go
Created December 21, 2019 19:13
Parsing 23andMe genome data
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"log"
"os"
"strconv"
@cpl
cpl / logbook.md
Last active December 18, 2019 15:51
SQL Murder Mystery https://mystery.knightlab.com/

SQL Murder Mystery

There's been a Murder in SQL City! The SQL Murder Mystery is designed to be both a self-directed lesson to learn SQL concepts and commands and a fun game for experienced SQL users to solve an intriguing crime.

A crime has taken place and the detective needs your help. The detective gave you the crime scene report, but you somehow lost it. You vaguely remember that the crime was a ​murder​ that occurred sometime on ​Jan.15, 2018​ and that it took place in ​SQL City​. Start by retrieving the corresponding crime scene report from the police department’s database.

Crime report

SELECT * FROM crime_scene_report
@cpl
cpl / honk.sh
Created November 23, 2019 18:16
HONK HONK
curl -o /tmp/goose.jpg -s https://cpl.li/assets/images/goose2.jpg >/dev/null
while true
do
say "honk!"
open -a Preview /tmp/goose.jpg
sleep $(( ( RANDOM % 300 ) + 1 ))
done
@cpl
cpl / LICENSE
Last active August 27, 2019 14:06
A Script for compiling ```.java``` files in the COMP16121 Course for UoM Students.
MIT License
Copyright (c) 2016 Alexandru-Paul Copil (thee-engineer)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@cpl
cpl / BLUETOOTH_HS-08_ZS040.cpp
Last active May 30, 2019 13:44
Arduino Bluetooth
#define TX 1
#define RX 0
#define LED 7
#define BUFFER_SIZE 16
char bufr[BUFFER_SIZE];
void setup(){
Serial.begin(9600);
pinMode(TX, OUTPUT);
@cpl
cpl / arduino_sound_lights.cpp
Created May 21, 2019 15:59
Arduino Sound LED Strip
#include <FastLED.h>
#define AUDIO_PIN A0
#define LEDST_PIN 5
#define LED_TYPE WS2811
#define BRIGHTNESS 100
#define NUM_LEDS 60
#define COLOR_ORDER GRB