Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

BONNAURE Olivier solisoft

🏠
Working from home
Block or report user

Report or block solisoft

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View layout.html
<!DOCTYPE html>
<html lang="{{ lang }}">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
@headers
<link rel="stylesheet" href="@css_vendors" />
<link rel="stylesheet" href="@css" />
</head>
<body>
@solisoft
solisoft / reorder.aql
Created Mar 5, 2019
ArangoDB / AQL : reorder collection
View reorder.aql
LET docs = (FOR doc IN @@collection SORT doc._key RETURN doc)
FOR i IN (0..(LENGTH(docs) - 1))
LET doc = docs[i]
UPDATE({ _key: doc._key, order: i }) IN @@collection
View docker-compose.yml
version: '3'
services:
arangodb:
image: arangodb:3.4.1
restart: always
environment:
ARANGO_ROOT_PASSWORD: XXXX
volumes:
- db-data:/var/lib/arangodb3
View arangodb_migrate.rb
require 'net/http'
require 'json'
DB_USER_SRC = 'root'.freeze
DB_USER_DST = 'root'.freeze
DB_PASS_SRC = 'XXXX'.freeze
DB_PASS_DST = 'XXXX'.freeze
DB_ENDPOINT_SRC = 'http+tcp://0.0.0.0:8529'.freeze
DB_ENDPOINT_DST = 'http+tcp://0.0.0.0:9529'.freeze
DUMP_PATH = '/home/dump/'.freeze # must exist
View keybase.md

Keybase proof

I hereby claim:

  • I am solisoft on github.
  • I am solisoft (https://keybase.io/solisoft) on keybase.
  • I have a public key ASBwAVlHY7lCxAqmsYdT_oq5hh8cRh9Fbgr25LZKUe8_Xwo

To claim this, I am signing this object:

@solisoft
solisoft / main.js
Last active Nov 27, 2017
ArangoDB Multipart/formdata
View main.js
'use strict';
const db = require('@arangodb').db;
const joi = require('joi');
const _ = require('lodash');
const createRouter = require('@arangodb/foxx/router');
const router = createRouter();
const querystring = require('querystring');
const crypt = require('@arangodb/crypto');
const fs = require("fs")
@solisoft
solisoft / auth.js
Created Nov 23, 2017
Authentification endpoint
View auth.js
'use strict';
const db = require('@arangodb').db;
const joi = require('joi');
const createRouter = require('@arangodb/foxx/router');
const sessionsMiddleware = require('@arangodb/foxx/sessions');
const jwtStorage = require('@arangodb/foxx/sessions/storages/jwt');
const createAuth = require('@arangodb/foxx/auth');
const auth = createAuth();
const router = createRouter();
@solisoft
solisoft / install_ruby_1-9-3.sh
Created Aug 24, 2017
Install ruby 1.9.3 within rbenv & archlinux
View install_ruby_1-9-3.sh
curl -fsSL https://gist.github.com/FiveYellowMice/c50490693d47577cfe7e6ac9fc3bf6cf.txt | PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig:/usr/lib/pkgconfig rbenv install --patch 1.9.3-p551
View chatserver.cr
require "kemal"
require "jwt"
require "json"
require "yaml"
require "arangocr"
require "redis"
# Load .env file
env_data = YAML.parse File.read(".env.yml") rescue Hash(String, String).new
env_data.each { |k, v| ENV[k.to_s] = v.to_s }
@solisoft
solisoft / server.cr
Last active Aug 13, 2017
multi rooms kemal websockets server
View server.cr
require "kemal"
require "json"
connected_sockets = {} of String => Array(HTTP::WebSocket)
connected_users = {} of String => Hash(String, JSON::Any)
def broadcast(data, sockets)
sockets.each do |socket|
socket.send data.to_json
end
You can’t perform that action at this time.