Skip to content

Instantly share code, notes, and snippets.

View felipsmartins's full-sized avatar
🇧🇷
loading, please wait a few seconds...

Martins, F. felipsmartins

🇧🇷
loading, please wait a few seconds...
View GitHub Profile
@felipsmartins
felipsmartins / local-container-registry.sh
Last active July 19, 2023 20:49
DOCKER CONTAINERS LOCAL REGISTRY
#https://docs.docker.com/registry/deploying/
docker run -d -p 5000:5000 --name registry -v /home/martins/devel/docker/local-registry:/var/lib/registry registry:2
# test steps
#docker pull ubuntu:16.04
#docker tag ubuntu:16.04 localhost:5000/my-ubuntu
#docker push localhost:5000/my-ubuntu
#docker image remove ubuntu:16.04
#docker image remove localhost:5000/my-ubuntu
#docker pull localhost:5000/my-ubuntu
@akitaonrails
akitaonrails / win11.xml
Created January 17, 2023 16:29
My Windows 11 libvirt XML configuration
<domain type='kvm'>
<name>win11-real</name>
<uuid>45768371-b871-4937-b7c2-60ed835011de</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/10"/>
</libosinfo:libosinfo>
</metadata>
<memory unit='KiB'>33554432</memory>
<currentMemory unit='KiB'>33554432</currentMemory>
@peerreynders
peerreynders / index.html
Last active March 21, 2021 06:52
Passing server generated data to client side code
<!doctype html>
<html lang="eng">
<!--
Originally:
https://elixirforum.com/t/passing-json-between-simple-reactjs-and-phoenix-elixir/19799/6
See also:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#Embedding_data_in_HTML
-->
<head>
@scharf
scharf / pymongo-mypy-stubs.md
Last active October 27, 2020 17:54
pymongo mypy stubs
@ericdouglas
ericdouglas / keyboard.md
Last active April 27, 2024 05:08
Cedilla under C (ç) in 'US international' keyboard layout in Linux

Add English (US, alt. intl.)

It's because the cedilla module isn't loaded by default when the locale is set to en, so you have to change the configuration files for gtk to add them:

  1. Edit configuration files:
sudo vim /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache

sudo vim /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache
@reeddunkle
reeddunkle / sm_commands.txt
Created February 17, 2019 18:02
TF2 plugin commands list
"Missing Commands will be added once I learn what they are, dont be shy, let me know if Im missing any!"
"Some plugins and commands may not be present on some servers, as this is an overall list."
"Admin Help" by AlliedModders LLC
sm_help - Displays SourceMod commands and descriptions
sm_searchcmd - Searches SourceMod commands
"Admin Menu" by AlliedModders LLC
sm_admin - Opens admin menu
@felipsmartins
felipsmartins / clang_crud_bandas.c
Created July 10, 2017 01:20
C - IFCE - crud bandas
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TRUE 1
#define FALSE 0
#define CHOICE_EXIT 0
#define SIZE_NOME_BANDA 80
#define SIZE_NOME_MUSICO 80
#define SIZE_MUSICO_FUNCAO 30
@guiwoda
guiwoda / AR_Cache_Repository.php
Last active February 25, 2023 21:11
AR (Eloquent) vs DM (Doctrine) gist
<?php
namespace App\ActiveRecord;
class PostRepository
{
private $cache;
public function __construct(Cache $cache)
{
// Any set() / get() cache implementation.
@weaverryan
weaverryan / Controller.php
Created April 21, 2015 17:22
Collecting Form Errors
<?php
// put this in your controller
protected function getErrorsFromForm(FormInterface $form)
{
$errors = array();
foreach ($form->getErrors() as $error) {
$errors[] = $error->getMessage();
}
@lavoiesl
lavoiesl / AbstractFixtureMigration.php
Last active October 18, 2023 19:23
Load Doctrine Fixtures when using Migrations in Symfony: AbstractFixtureMigration
<?php
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader as Loader;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;