Skip to content

Instantly share code, notes, and snippets.

@marcopeg
marcopeg / card-deck.data.sql
Last active October 26, 2022 06:24
Card deck db schema for PostgreSQL
View card-deck.data.sql
INSERT INTO "ranks" VALUES
('A'), ('K'), ('Q'), ('J'), ('1'), ('2'), ('3'), ('4'), ('5'), ('6'), ('7'), ('8'), ('9'), ('10');
INSERT INTO "suits" VALUES
('♥️'), ('♠️'), ('♣️'), ('♦️');
INSERT INTO "brands" VALUES
('b1'), ('b2');
View keybase.md

Keybase proof

I hereby claim:

  • I am marcopeg on github.
  • I am marcopeg (https://keybase.io/marcopeg) on keybase.
  • I have a public key ASD5CuWpREPWnZmMgwTu0eusZg0cyIlXDlS5JdMlQy2vZwo

To claim this, I am signing this object:

@marcopeg
marcopeg / MACBOOK-SETUP.md
Last active July 31, 2021 06:28
Notes on setting up my Mac
View MACBOOK-SETUP.md
View fetchq-setup-dev
#/bin/bash
# OSX
# bash <(curl -fsSL https://gist.github.com/marcopeg/cc0fab6c1be1fafb7fd7c4fd87f08ff9/raw)
#
# Linux
# wget -O - https://gist.github.com/marcopeg/cc0fab6c1be1fafb7fd7c4fd87f08ff9/raw | bash -s
#
View Kitchen Alarm with NodeConfEU Badge
// This is no elegant code but it works and now I go for a beer :-)
let timeLeft = 0;
function beep(freq, time, callback) {
var ll = require("NRF52LL");
// set up D0 and D1 as outputs
digitalWrite(D0,0);
digitalWrite(D1,0);
// create two 'toggle' tasks, one for each pin
View NodeConfEU Badge Program
// Customize your badge
const line1 = 'Marco';
const line2 = '@thepeg marcopeg.com';
// Conf program
const schedule = [
{
start: new Date(2017, 10, 6, 14, 0),
View VI on Swedish Keyboard
End of line ...................................... Alt + 4
Beginning of line ................................ 0 (Zero)
Beginning of the file ............................ g + g
Next word ........................................ e
Previous word .................................... b
Append ........................................... a
Append (end of line) ............................. Shift + a
New line under the current one ................... o
http://www.viemu.com/vi-vim-cheat-sheet.gif
View docker ec2
# Docker
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
# Docker Compose 1.9.0
sudo curl -L https://github.com/docker/compose/releases/download/1.11.1/docker-compose-`uname -s`-`uname -m` | sudo tee /usr/local/bin/docker-compose > /dev/null
sudo chmod +x /usr/local/bin/docker-compose
View setup ssh on server
mkdir ~/.ssh \
&& touch ~/.ssh/authorized_keys \
&& chmod 700 ~/.ssh \
&& chmod 600 ~/.ssh/authorized_keys
@marcopeg
marcopeg / remote-gist.sh
Last active March 8, 2023 16:12
Download and executes a remote gitst
View remote-gist.sh
#/bin/bash
#
# Download and executes a remote GitHub gist
# it will store a local cache to improve performances
#
# run `./script --update` to flush local cache
#
# -- Custom Settings