This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <WinSock2.h> | |
// 1: | |
void init_sock() | |
{ | |
WSADATA wsaData; | |
WSAStartup(MAKEWORD(2, 2), &wsaData); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ignore_for_file: empty_catches | |
import 'dart:async'; | |
import 'dart:convert'; | |
import 'package:firestation_manager_app/data/helpers/constants/network_constants.dart'; | |
import 'package:latlong2/latlong.dart'; | |
import 'package:web_socket_channel/web_socket_channel.dart'; | |
import 'dart:developer'; | |
import 'dart:io'; | |
import 'dart:isolate'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
service BookService { | |
rpc GetBooks (Empty) returns (BookList); | |
rpc GetBookByTitle (BookTitle) returns (Book); | |
rpc AddBook (Book) returns (Book); | |
rpc UpdateBook (UpdateBookRequest) returns (Book); | |
rpc DeleteBook (BookTitle) returns (DeleteBookResponse); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = gcc | |
CFLAGS = -Wall -fPIC | |
LIBNAME = my_lib | |
all: $(LIBNAME).so | |
$(LIBNAME).so: my_lib.o | |
$(CC) -shared -o $@ $^ | |
my_lib.o: my_lib.c my_lib.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker pull postgres:latest | |
docker run -d \ | |
--name shard1 \ | |
-e POSTGRES_PASSWORD=postgres \ | |
-e POSTGRES_USER=postgres \ | |
-e POSTGRES_DB=postgres \ | |
-p 5435:5432 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from google.oauth2 import service_account | |
import google.auth.transport.requests | |
import google | |
SCOPES = ['https://www.googleapis.com/auth/firebase.messaging'] | |
def get_access_token(): | |
"""Retrieve a valid access token that can be used to authorize requests.""" | |
credentials = service_account.Credentials.from_service_account_file( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse | |
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse | |
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POSTGRES_DB= | |
pg_dump $POSTGRES_DB -U postgres | gzip > $POSTGRES_DB-$(date +%d-%m-%y_%H-%M).tar.gz | |
gunzip -c filename.gz | psql -U u -d db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
echo ">> Installing vim editor..." | |
sudo apt install vim -y | |
echo ">> Installing python3.11..." | |
sudo add-apt-repository ppa:deadsnakes/ppa | |
sudo apt update | |
sudo apt install python3.11 -y | |
sudo apt install python3.11-venv -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NO_COLOR = "0" # Text Reset | |
BLACK = "0;30" # Black | |
RED = "0;31" # Red | |
GREEN = "0;32" # Green | |
YELLOW = "0;33" # Yellow | |
BLUE = "0;34" # Blue | |
PURPLE = "0;35" # Purple | |
CYAN = "0;36" # Cyan | |
WHITE = "0;37" # White |
NewerOlder