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 / vue-component-example1.js
Created May 31, 2020 16:46
Vue Component Example 1
Vue.component({
template: `<div></div>`
})
@alxlion
alxlion / react-es6-class-example1.jsx
Created May 31, 2020 16:45
React ES6 Class Example 1
class MyComponent extends React.Component {
render() {
return(<div />)
}
}
@alxlion
alxlion / vue-component-example1.vue
Created May 31, 2020 16:34
Vue Component Example 1
<template>
<div id="myComponent">
<Counter />
<span v-if="reading">Hello reader !</span>
</div>
</template>
<script>
import Counter from "@/components/Counter";
@alxlion
alxlion / gist:2881c29649bc5d477954f79b3071e408
Last active March 11, 2019 15:00
Figure component Hugo/NetlifyCMS
CMS.registerEditorComponent({
// Internal id of the component
id: "figure",
// Visible label
label: "Figure",
// Fields the user need to fill out when adding an instance of the component
fields: [
{name: 'src', label: 'Image', widget: 'image'},
{name: 'caption', label: 'Caption', widget: 'string'},
{name: 'link', label: 'Link', widget: 'string'},
@Scope("singleton")
public class InternalDatabase {
private List<Transaction> memory;
public InternalDatabase() {
if (this.memory == null) {
this.memory = new ArrayList<>();
}
}
@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();
@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();

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 / 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
@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;