Skip to content

Instantly share code, notes, and snippets.

View ybouhjira's full-sized avatar

Youssef Bouhjira ybouhjira

View GitHub Profile
@ybouhjira
ybouhjira / three-exp.ts
Created March 23, 2023 02:10
Stripped GLSL fragment shader
import * as THREE from 'three'
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
const geometry = new THREE.BoxGeometry(1, 1, 1);
@ybouhjira
ybouhjira / AbstractStore.ts
Created January 8, 2020 09:39
AbstractStore.ts
import cloneDeep from 'lodash.clonedeep';
import * as shortId from 'shortid';
export abstract class AbstractStore<T> {
private entities: Map<string, T> = new Map();
create(data: T): T {
const entity = cloneDeep(data);
entity.id = shortId.generate();
this.entities.set(entity.id, entity);
console.log('Loading function');
const doc = require('dynamodb-doc');
const dynamo = new doc.DynamoDB();
/**
* Demonstrates a simple HTTP endpoint using API Gateway. You have full
* access to the request and response payload, including headers and
@ybouhjira
ybouhjira / docker-compose-install.sh
Created October 16, 2017 19:19
Install docker compose
#!/bin/bash
set -e
sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo docker-compose --version
@ybouhjira
ybouhjira / docker-install.sh
Last active October 16, 2017 19:15
Install docker
#!/bin/bash
# author @ybouhjira
set -e
wget https://get.docker.com
mv index.html docker.sh
chmod +x docker.sh
./docker.sh
sudo docker -v
@ybouhjira
ybouhjira / selenium _log
Created August 20, 2017 15:54
Selenium Logs
▶ java -jar selenium-server-standalone-3.0.1.jar
16:53:31.518 INFO - Selenium build info: version: '3.0.1', revision: '1969d75'
16:53:31.519 INFO - Launching a standalone Selenium Server
2017-08-20 16:53:31.537:INFO::main: Logging initialized @248ms
16:53:31.591 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
16:53:31.591 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
16:53:31.592 INFO - Driver class not found: com.opera.core.systems.OperaDriver
16:53:31.592 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
@ybouhjira
ybouhjira / foundation-browserify.js
Created August 4, 2017 16:16
Use Zurb Foundation with browserify
import $ from 'jquery';
import {Foundation} from 'foundation-sites/js/foundation.core';
import {OffCanvas} from 'foundation-sites/js/foundation.offcanvas';
import {Reveal} from 'foundation-sites/js/foundation.reveal';
Foundation.plugin(OffCanvas, 'OffCanvas');
Foundation.plugin(Reveal, 'Reveal');
Foundation.addToJquery($);
@ybouhjira
ybouhjira / index.js
Created March 25, 2017 23:08
todos.js
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const app = express();
app.use(cors());
app.use(bodyParser.json());
const todos = [];
@ybouhjira
ybouhjira / AppConvertSerializationCommand.php
Last active January 23, 2017 01:27
Convert serialization annotations to YAML
<?php
namespace AppBundle\Command;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\ClassMetadata;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@ybouhjira
ybouhjira / attr.html
Created January 15, 2017 18:39
Awesome attribute
<!DOCTYPE html>
<html>
<head>
<title>
</title>
</head>
<body>
<radiogroup data-show-when-checked="mydiv" data-enable-on="oui">