Skip to content

Instantly share code, notes, and snippets.

View pauldijou's full-sized avatar

Paul Dijou pauldijou

View GitHub Profile
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active June 29, 2024 13:05
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@Timshel
Timshel / Chiffrage.mkd
Last active August 29, 2015 13:56
Securité et confidentialité

Objectif : Créer une partition case sensitive chiffrée

Case sensitive : Pour les développeurs pour éviter les surprises en recette/prod.

Chiffrée : Pour éviter que le voleur du métro fasse n'importe quoi avec ce qui traine sur votre machine.

Autres solutions : True crypt, File vault sur tout le mac.

Fonctionnement :
A chaque démarrage de la machine vous devrez renseigner une pass-phrase pour déverrouiller la partition en question.

@jboner
jboner / akka-cluster-implementation-notes.md
Last active March 4, 2023 22:30
Akka Cluster Implementation Notes

Akka Cluster Implementation Notes

Slightly disorganized but reasonably complete notes on the algorithms, strategies and optimizations of the Akka Cluster implementation. Could use a lot more links and context etc., but was just written for my own understanding. Might be expanded later.

Links to papers and talks that have inspired the implementation can be found on the 10 last pages of this presentation.

Akka Gossip

Gossip state

This is the Gossip state representation:

/*
SublimeLinter default settings
*/
{
/*
Sets the mode in which SublimeLinter runs:
true - Linting occurs in the background as you type (the default).
false - Linting only occurs when you initiate it.
"load-save" - Linting occurs only when a file is loaded and saved.
@jkyamog
jkyamog / gist:5687702
Last active December 17, 2015 23:09
reactive mongo that can be used with angular resources. make sure to perform validation before inserts and updates. there are 2 json readers, this is used to transform mongo object to and from the front end (FE). Then 2 sample api calls to use them, there is an assumption that id or _id will always be there, otherwise its a runtime exception.
val mongoToFE =
__.json.update((__ \ 'id).json.copyFrom( (__ \ '_id \ '$oid).json.pick )) andThen
(__ \ '_id).json.prune
val FEtoMongo =
__.json.update((__ \ '_id \ '$oid).json.copyFrom( (__ \ 'id).json.pick )) andThen
(__ \ 'id).json.prune
Async {
val items = collection.find(BSONDocument("_id" -> objectId)).cursor[JsObject]
@almeidap
almeidap / BaseDAO.scala
Last active March 25, 2023 12:26
DAO design for ReactiveMongo using JSONCollection and Play2 Scala JSON API (work in progress).
package core.dao
import scala.concurrent.Future
import play.api.Logger
import reactivemongo.core.commands.LastError
import reactivemongo.core.errors.DatabaseException
import core.db.MongoHelper
@sadache
sadache / gist:4714280
Last active July 14, 2022 15:09
Playframework: Async, Reactive, Threads, Futures, ExecutionContexts

Asynchronicity is the price to pay, you better know what you're paying for...

Let's share some vocabulary first:

Thread: The primitive responsible of executing code on the processor, you can give an existing (or a new) Thread some code, and it will execute it. Normally you can have a few hundreds on a JVM, arguments that you can tweak your way out to thousands. Worth noting that multitasking is achieved when using multiple Threads. Multiple Threads can exist for a single processor in which case multitasking happens when this processor switches between threads, called context switching, which will give the impression of things happenning in parallel. An example of a direct, and probably naive, use of a new Thread in Java:

public class MyRunnable implements Runnable {
  public void run(){
 System.out.println("MyRunnable running");
@dohzya
dohzya / test.html
Created January 25, 2013 15:50
Récupérer la réponse d'un gist sans la question
<html>
<head>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="https://gist.github.com/4635425.js"></script>
<script>
$(function(){
$(".gist .gist-file").each(function(){
var $file = $(this);
@pauldijou
pauldijou / try.md
Created December 5, 2012 14:46
Trying to install DataStax Community on Fedora 17