Skip to content

Instantly share code, notes, and snippets.

View Kerollmops's full-sized avatar
🍼
Meilisearch needs care

Clément Renault Kerollmops

🍼
Meilisearch needs care
View GitHub Profile
// Ruby = 5.times { |i| puts i }
// JS = (1).times(function(i){console.log(i);})
Number.prototype.times = function(cb) {
var i = -1;
while (++i < this) {
cb(i);
}
return +this;
@Kerollmops
Kerollmops / gist:57da53105ca9bd9db78a
Created September 19, 2014 14:29
Maven fsriver build
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Elasticsearch File System River Plugin 1.3.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-maven) @ fsriver ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) @ fsriver ---
[INFO]
@Kerollmops
Kerollmops / maze.java
Last active August 29, 2015 14:16
Maze resolver (bad version)
/*
rouge: personnage
bleu: win !
noir: mur
blanc: vide
*/
boolean touch_wall = false;
int compteur = 0;
@Kerollmops
Kerollmops / view matrices.c
Created May 24, 2015 11:31
view matrices
t_mat4 classic_mat4_pers_proj(float width, float height)
{
float aspect;
float znear;
float zfar;
aspect = width / height;
znear = 0.1f;
zfar = 1000.f;
return (mat4_pers_proj(60.f, aspect, znear, zfar));
@Kerollmops
Kerollmops / vectext.glsl
Created May 26, 2015 16:27
vecteur texture
vec3 vec111 = normalize(vec3(1, 1, 1));
vec3 dist = vec3( abs(vert_normal_model.x - vec111.x),
abs(vert_normal_model.y - vec111.y),
abs(vert_normal_model.z - vec111.z));
if (dist.z < dist.x && dist.z < dist.y) {
uv = vec2(vp_model.x, vp_model.y);
}
else if (dist.y < dist.x && dist.y < dist.z) {
int Core::_manhattan(Node const &node, Node const &goal) {
int sum;
size_t gridSize;
sum = 0;
gridSize = node.getGrid().getSize();
for (size_t i = 0; i < gridSize; ++i) {
for (size_t j = 0; j < gridSize; ++j) {
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: crenault <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2015/05/09 18:00:27 by crenault #+# #+# #
# Updated: 2015/05/28 14:58:35 by crenault ### ########.fr #
# #
@Kerollmops
Kerollmops / scale_pos.c
Last active December 23, 2015 16:39
Fillit change trick
// 213s, before
inline t_pos scale_pos(t_pos pos)
{
return ((t_pos){pos.x + FENCE_WIDTH, pos.y + FENCE_WIDTH});
}
// 93.23s, now
inline void scale_pos(t_pos *pos)
{
pos->x += FENCE_WIDTH;
let road_width = 10.0f32;
let main_road = Road::new();
let bezier1 = Bezier::new(control_points1);
let bezier2 = Bezier::new(control_points2);
// compute connection curve from other road stretch
let hermite = HermiteSpline::from_curves(&bezier1, &bezier2);
let stretch1 = StretchRoad::from_curve(bezier1, road_width);
let stretch2 = StretchRoad::from_curve(bezier2, road_width);
@Kerollmops
Kerollmops / memmove_details.md
Last active April 24, 2016 15:20
French memmove details

memmove details

memmove

void *memmove(void *dst, const void *src, size_t len);

Copier la source dans la destination d'une maniere non destructive.