Skip to content

Instantly share code, notes, and snippets.

View loloof64's full-sized avatar
💻
Developing projects in Flutter

laurent bernabé loloof64

💻
Developing projects in Flutter
  • Bayonne (France) in Pyrénées Atlantiques (64)
View GitHub Profile
@loloof64
loloof64 / App.vue
Created June 8, 2019 21:11
Udemy VueJS - Slots
<template>
<div class="container">
<div class="row">
<div class="col-xs-12">
<br>
<button class="btn btn-primary" @click="selected = 'blue'">Load Blue Template</button>
<button class="btn btn-success" @click="selected = 'green'">Load Green Template</button>
<button class="btn btn-danger" @click="selected = 'red'">Load Red Template</button>
<hr>
<app-blue v-show="blueOn">
@loloof64
loloof64 / cargo.toml
Last active July 6, 2019 21:45
TicTacToe in Rust+Yew (Launching with cargo web)
[package]
name = "tic-tac-toe-asm"
version = "0.1.0"
authors = ["Laurent Bernabé <[email protected]>"]
edition = "2018"
[dependencies]
yew = "0.6.0"
stdweb = "0.4.17"
@loloof64
loloof64 / Makefile
Last active December 3, 2019 13:40
Attempt to compile nmrugg/stockfish.js for React-Native
OBJS = bitbase.o bitboard.o endgame.o evaluate.o main.o \
material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o \
search.o thread.o timeman.o tt.o uci.o ucioption.o
EXE = stockfish.wasm
CXXFLAGS = -Oz -DNDEBUG --closure 1 -s ENVIRONMENT=web -s INLINING_LIMIT=1 -s WASM=1 -fPIC -s EVAL_CTORS=0 -s ALLOW_MEMORY_GROWTH=1 -s BINARYEN_ASYNC_COMPILATION=1 -s NO_FILESYSTEM=1 -s STANDALONE_WASM
LDFLAGS = -Oz -DNDEBUG --closure 1 -s ENVIRONMENT=web -s INLINING_LIMIT=1 -s WASM=1 -fPIC -s EVAL_CTORS=0 -s ALLOW_MEMORY_GROWTH=1 -s BINARYEN_ASYNC_COMPILATION=1 -s NO_FILESYSTEM=1 -s STANDALONE_WASM
clean:
@loloof64
loloof64 / chessboard.go
Last active September 2, 2019 15:09
Trying to create a chessboard in Fyne
package main
import (
"image/color"
"fyne.io/fyne"
"fyne.io/fyne/canvas"
"fyne.io/fyne/layout"
"fyne.io/fyne/widget"
)
@loloof64
loloof64 / cargo.toml
Last active September 20, 2019 15:39
ImGui-Rust Hello World a bit simplified (Caution ! need directory src/support and according files in it : 2 source files)
[package]
name = "imgui-hello-world"
version = "0.1.0"
authors = ["loloof64"]
edition = "2018"
[dependencies]
clipboard = "0.5"
imgui = "0.2.1"
imgui-glium-renderer = "0.2.0"
@loloof64
loloof64 / MyButton.js
Created September 27, 2019 11:20
Udemy Web comppnent course - Exercise 1
class MyButton extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open'});
this.shadowRoot.innerHTML = `
<button>Show</button>
<p id="info-box">More infos!</p>
<style>
#info-box {
display: none;
@loloof64
loloof64 / constraint_api.js
Last active October 22, 2019 21:51
simple adaptation of ecma5 grammar made for chevrotain
"use strict"
const tokenize = require("./constraint_script_lexer").tokenize
const ConstraintScriptParser = require("./constraint_script_parser").ConstraintScriptParser
const parserInstance = new ConstraintScriptParser()
function parse(str) {
const tokens = tokenize(str)
parserInstance.input = tokens
@loloof64
loloof64 / main.py
Created February 18, 2020 17:06
Python 3 Tkinter : Greet user
# coding: utf-8
from tkinter import Tk, Label, Entry, Button
from tkinter.messagebox import showinfo, showerror
def greet(name):
if len(name) > 0 :
showinfo(title="", message="Bonjour {} !".format(name))
else :
showerror(title="Aucun nom", message="Aucun prénom renseigné")
@loloof64
loloof64 / SimpleDragAndDrop.kt
Last active April 19, 2022 01:23
A simple Drag and Drop in Jetpack compose 1.0.0-alpha07 (needing adding imports automatically from Android Studio - Canary channel)
@Preview
@Composable
fun DragNDropComponent() {
Column(modifier = Modifier.size(100.dp).background(Color.Red)) {
// The updatable Drag and Drop data
var x by remember{ mutableStateOf(0f)}
var y by remember { mutableStateOf(0f)}
// The offsets that is always update, that place the component to be dragged
val offsetX = with(DensityAmbient.current) {
@loloof64
loloof64 / DragAndDropWithAnimation.kt
Last active December 17, 2020 01:49
Drag and drop then animation for going back (Jetpack compose 1.0.0-alpha07) : Thank you Joost Klitsie for your help on the Slack channel :)
@Preview
@Composable
fun DragAndDropComponent() {
Column(modifier = Modifier.size(300.dp).background(Color.Red)) {
val x = animatedFloat(150f)
val y = animatedFloat(150f)
val bouncySpring = SpringSpec(
dampingRatio = DampingRatioMediumBouncy,
stiffness = StiffnessLow,
visibilityThreshold = DefaultDisplacementThreshold)