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 / lessOrMoreGame.hs
Created January 27, 2016 23:55
The "less or more" guessing game in haskell (Simple haskell training)
module Main where
import System.Random
import Text.Read (readMaybe)
main::IO()
main = do
limit <- getPositiveInteger "Give me the secret number limit :"
gen <- newStdGen
let secretNumber = chooseSecretNumber gen limit
@loloof64
loloof64 / android_res_copy
Last active December 4, 2016 21:24
Copying android pictures from a downloaded resource folder into an Android Studio resources folders
#!/bin/bash
FOLDER_DOES_NOT_EXIST=1
FOLDER_LACKS_SOME_SUBFOLDERS=2
PROMPT_EMPTY=3
# Getting the source folder
echo -n "What is the android resource pack root folder (the one that has the pictures to be copied) ? ($PWD) "
read srcFolder
@loloof64
loloof64 / swapping_variables_rust
Created September 11, 2016 09:09
How creating and swapping variables is very easy in Rust
fn main() {
let (a,b) = (10, 20);
println!("Before swapping : a = {} and b = {}.", a, b);
let (b,a) = (a,b);
println!("After swapping : a = {} and b = {}.", a, b);
}
@loloof64
loloof64 / reversing_string
Created September 11, 2016 18:43
Reversing a string in Rust
fn main() {
let name_reversed:String = "Loloof64".chars().rev().collect();
println!("{}", name_reversed);
}
@loloof64
loloof64 / main.cpp
Last active September 16, 2016 12:15
C++ variadic sum doubles
#include <iostream>
#include <cstdarg>
#include <limits>
using namespace std;
double myAdd(double a, double b, ...);
int main()
{
@loloof64
loloof64 / SquaresForVector.cpp
Last active March 11, 2017 00:33
Example of c++11/14 numeric vector transform into squares
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
template <typename T>
void traceVectorValues(const std::vector<T> &);
template <typename T>
void transformVectorWithUnaryFunction(std::vector<T> &, std::function<T(T)>);
@loloof64
loloof64 / testComponent.js
Created October 24, 2017 21:53
ReactNative Drag and drop with boundaries
import React, { Component } from 'react';
import { StyleSheet, View, Animated, PanResponder, UIManager, findNodeHandle } from 'react-native';
import _ from 'underscore';
class Square {
constructor(value, x, y, cellsSize) {
this.value = value;
this.pan = new Animated.ValueXY();
this.cellsSize = cellsSize;
@loloof64
loloof64 / main.cpp
Created October 31, 2017 18:22
Simple stream redirection and listener try
#include <iostream>
#include <sstream>
#include <streambuf>
#include <string>
class OStringStreamListener
{
public:
virtual void consume(const std::string &input) = 0;
};
@loloof64
loloof64 / index.html
Last active March 29, 2018 20:04
Site findThePrecious.com
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Find the precious</title>
</head>
<body>
<header>
<nav id="main_menu">
<ul>
@loloof64
loloof64 / index.html
Created March 31, 2018 21:56
Wanted !
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Captured fellow</title>
<link rel="stylesheet" href="./styles/main.css" />
</head>
<body>
<div class="reward">
<img src="./images/gandalf.png" alt="fellow_photo" />