Skip to content

Instantly share code, notes, and snippets.

View asmarton's full-sized avatar
🇷🇴

Alexandru-Sergiu Marton asmarton

🇷🇴
  • Freelancer
  • Romania
  • 22:40 (UTC +03:00)
View GitHub Profile
@asmarton
asmarton / profile.md
Last active November 19, 2022 19:38
About me
@asmarton
asmarton / instructions.txt
Created April 26, 2019 14:45
Raspberry Pi 3" LCD setup
Pt Raspbian Jessie:
-se creeaza /etc/modules-load.d/fbtft.conf
ce contine:
"spi-bcm2835
flexfb
fbtft_device"
-se creeaza /etc/modprobe.d/fbtft.conf
ce contine:
options fbtft_device name=flexpfb rotate=180 fps=60 gpios=dc:18,reset:7,wr:17,cs:4,db00:22,db01:23,db02:24,db03:10,db04:25,db05:9,db06:11,db07:8
options flexfb width=400 height=240 buswidth=8 init=-1,0xb0,0x0,-1,0x11,-2,120,-1,0x3A,0x55,-1,0xC2,0x33,-1,0xC5,0x00,0x1E,0x80,-1,0x36,0x28,-1,0xB1,0xB0,-1,0xE0,0x00,0x04,0x0E,0x08,0x17,0x0A,0x40,0x79,0x4D,0x07,0x0E,0x0A,0x1A,0x1D,0x0F,-1,0xE1,0x00,0x1B,0x1F,0x02,0x10,0x05,0x32,0x34,0x43,0x02,0x0A,0x09,0x33,0x37,0x0F,-1,0x11,-1,0x29,-3
@asmarton
asmarton / fish_greeting.fish
Last active April 24, 2019 09:15
Show inspirobot quotes on fish shell startup
function fish_greeting
printf (http -p 'b' 'https://inspirobot.me/api?generateFlow=1&sessionID=452cf4f2-1415-497c-9c83-bc5688d6367e' | jq '.["data"]' | jq '.[] | select(.type=="quote")' | jq '."text"' | head -n 1 | sed 's/\[pause [[:digit:]]\+\]//g')
end
@asmarton
asmarton / gen_tic_csharp_nationals.py
Created April 16, 2019 12:34
Participanți la etapa națională a Olimpiadei de TIC, sectiunea C#
import requests
from bs4 import BeautifulSoup
# URL-ul clasamentului national la sectiunea C#
url = 'https://onti.ro/oti/anc/csarp/judeteana/csarp_pagina_cn.php'
# Downloadeaza pagina
res = requests.get(url)
# Fa o supa din HTML-ul paginii
#include <vector>
#include <fstream>
int main()
{
auto in_file = std::ifstream("INPUT_FILE.in");
auto out_file = std::ifstream("OUTPUT_FILE.out");
uint32_t n, n_muchii = 0;
colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"]
for color in colors:
if color == "green":
print("Found green in the list!")
print("Hello World!")
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!\n";
return 0;
}
@asmarton
asmarton / factorial.py
Created October 28, 2018 05:55
A python program to compute the factorial for a given number. Written for Google Code-in
def factorial(n: int):
"""Computes the factorial for a given number
Doesn't implement any limitation on the input's size because
as specified in the python documentation for Numeric Types
https://docs.python.org/2/library/stdtypes.html#numeric-types-int-float-long-complex
"Long integers have unlimited precision"
:return: The factorial of n
"""
set __toaster_color_orange FD971F
set __toaster_color_blue 6EC9DD
set __toaster_color_green A6E22E
set __toaster_color_yellow E6DB7E
set __toaster_color_pink F92672
set __toaster_color_grey 554F48
set __toaster_color_white F1F1F1
set __toaster_color_purple 9458FF
set __toaster_color_lilac AE81FF