Skip to content

Instantly share code, notes, and snippets.

View alxlion's full-sized avatar
🏗️
Building

Alexandre Lion alxlion

🏗️
Building
View GitHub Profile
@alxlion
alxlion / gist:6088316
Last active April 8, 2016 20:07
Look and feel system UI
try {
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
}
catch (UnsupportedLookAndFeelException | ClassNotFoundException |
IllegalAccessException | InstantiationException e) { e.printStackTrace();}
/************************************************* receiver ************************************************/
/*
Example for receiving
http://code.google.com/p/rc-switch/
If you want to visualize a telegram copy the raw data and
paste it into http://test.sui.li/oszi/
*/
@alxlion
alxlion / main.c
Last active February 17, 2016 10:20
Correction TP 1GCC - 2015-2016
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#define MAX_LENGTH 1024
void convertToBinary(char* word); // Ces prototypes de fonctions (ou signatures) pouvaient
void convertToHex(char* word); // très bien se trouver dans un fichier .h et leur implémentation
void convertToBase64(char* word); // dans un fichier .c correspondant.
@alxlion
alxlion / CMakeLists.txt
Created February 19, 2016 22:43
Include ncurses lib in Cmake project
find_package(Curses REQUIRED)
include_directories(${CURSES_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${CURSES_LIBRARIES})
@alxlion
alxlion / style.css
Created April 16, 2016 09:28
Fix dark input Firefox
input:not(.urlbar-input):not(.textbox-input):not(.form-control):not([type='checkbox'])
:not(#search_form_input):not(#search_form_input_clear):not(#search_button):not(#search_form_input_homepage) {
-moz-appearance: none !important;
background-color: white;
color: black;
}
#downloads-indicator-counter {
color: white;
}
@alxlion
alxlion / script.sh
Created September 17, 2016 16:31
Auto create swap DigitalOcean
#!/bin/bash
sudo fallocate -l 1G /swapfile;
chmod 600 /swapfile;
mkswap /swapfile;
swapon /swapfile;
echo "/swapfile none swap sw 0 0" >> /etc/fstab;
@alxlion
alxlion / style.css
Last active October 2, 2016 14:38
DarKiwi style
@-moz-document domain("zen.myatos.net") {
body {
background-color: #222 !important;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGBAMAAACDAP+3AAAAGFBMVEUfHx8eHh4dHR0bGxshISEiIiIlJSUjIyM9IpsJAAAFjUlEQVR4AT3UuZLcOBaF4QuI2XJxboIhF/eQFe1WovoBAAqccpkaZpc5+4yrXa8/RGpx/lrIXPjFCYjTp9z8REqF4VYNWB3Av3zQJ6b6xBwlKB/9kRkCjXVwGH3ziK5UcjFHVkmgY6osiBsGDFfseqq2ZbTz7E00qBDpzOxnD7ToABeros1vM6MX0rBQaG1ith1A/HJkvkHxsPGJ82dP8vVCyWmbyPTaAfGzg40bgIdrv2f3pBVPycUcufx+BSUUWDuCZi6zBqdM50ElKYPODqtLDjc31rBb9CZ59lbN/JScuMxHLUBcGiy6QRH9zpwgZGhRj8qSydPVgNNVgbWqYX3HbM9K2rqTnKVmsmwKWzc1ffEd20+Zq3Ji65kl6TSjALNvzmJt4Pi2f1etytGJmy5erLAgbNY4bjykC3YCLIS3nSZMKgwRsBarWgjdeVzIEDzpTkoOUArTF4WFXYHwxY585sT0nmTYMxmXfs8fzwswfnam8TMU49bvqSRnyRPnqlno4tVQQiH2A9Za8tNTfXQ0lxbSxUaZna0uLlj9Q0XzD96CpsOZUftolINKBWJpAOoAJC0T6QqZnOtfvcfJFcDrD4Cuy5Hng316XrqzJ204HynyHwWed6i+XGF40Uw2T7Lc71HyssngEOrgONfBY7wvW0UZdVAma5xmSNjRp3xkvKJkW6aSg7PK4K0+mbKqYB0WYBgWwxCXiS74zBCVlEFpYQDEwjcA1qccb5yO6ZL8ozt/h3wHSCdWzLuqxU2ZZ9ev9MvRMbMvV9BQgN0qrFjlkzPQ

Keybase proof

I hereby claim:

  • I am lnalex on github.
  • I am lnalex (https://keybase.io/lnalex) on keybase.
  • I have a public key ASCrYsJfvIB7F8wsy8qTt7-_G6kAi99wYepdJNY6KW8o8wo

To claim this, I am signing this object:

@alxlion
alxlion / Transaction.java
Last active August 18, 2017 15:53
Transaction entity
public class Transaction {
private UUID id;
private float amount;
private Date date;
public Transaction(float amount) {
this.amount = amount;
this.date = new Date();
this.id = UUID.randomUUID();
@RestController
@RequestMapping("/transactions")
public class TransactionController {
@Autowired
private InternalDatabase internalDatabase;
@GetMapping(produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<Transaction> findAll() {
return this.internalDatabase.get();